feat(api)!: rename POST /api/chat/workflow → POST /api/chat (breaking)
Merged
SW
5mo ago+35+35+01234567890123456789-4-4-0123456789
Step 2 of the /api/chat/workflow → /api/chat rename (chat#1767), implementing the merged docs contract (docs#235).
Per maintainer decision, this is a hard rename, not an additive alias: it adds POST /api/chat and deletes app/api/chat/workflow/route.ts.
⚠️ BREAKING — deploy coordination required
Prod consumers still POST /api/chat/workflow:
- chat —
useChatTransport.ts:49 - open-agents —
chat-api-client.ts:21(CHAT_API_POST_PATH) - any external API-key callers
This must NOT be promoted to main/prod until the chat (step 3) and open-agents (step 4) repoints are merged and deployed — otherwise those consumers 404. Recommend holding the test→main promotion until the consumer PRs are ready to ship together.
Changes
- add
app/api/chat/route.ts(POST+OPTIONS) delegating tohandleChatWorkflowStream - delete
app/api/chat/workflow/route.ts - fix docstrings that named the removed path
TDD (red → green → refactor)
app/api/chat/__tests__/route.test.tswritten first → red (missing route) → green after addingroute.ts.- No refactor needed.
Verification
- 2 route tests + 20
handleChatWorkflowStreamhandler tests pass; lint clean. - (The only
tscblip is a stale.next/typesreference to the deleted route — regenerates on a fresh build.) - Preview after deploy:
POST /api/chatstreams;POST /api/chat/workflow→ 404 (intentionally removed).
Follow-ups (must ship before this hits prod)
- chat — repoint
useChatTransport→/api/chat - open-agents — repoint
CHAT_API_POST_PATH→/api/chat
Summary by CodeRabbit
- Documentation
- Updated API documentation for the chat endpoint.
/api/chatis now the primary endpoint, while/api/chat/workflowis documented as a backward-compatible alias. No functional changes.
- Updated API documentation for the chat endpoint.