⚠️ CUTOVER (do not merge until coordinated): Promote test → main — /api/chat rename (api#645)

Merged
SW
6mo ago
+35-4

Draft on purpose — this is the breaking half of the /api/chat/workflow → /api/chat cutover (chat#1767). Merging this promotes api#645 to prod, which deletes /api/chat/workflow (no alias).

🚦 Do NOT mark ready / merge until the cutover window is go

The moment this deploys to prod, every consumer still on /api/chat/workflow 404s. Required lockstep:

  1. ✅ Merge open-agents#47 (open-agents → /api/chat)
  2. Merge this (api test→main) — prod api drops /workflow, adds /api/chat
  3. Merge the chat promotion (chat test→main — sibling cutover PR) so prod chat is on /api/chat
  4. Ensure open-agents is deployed to prod in the same window
  5. Smoke-test prod: new chat streams via POST /api/chat; POST /api/chat/workflow → 404

⚠️ External API-key callers get no alias — they must move to /api/chat.

Net content

  • api#645 — add POST /api/chat (delegates to handleChatWorkflowStream) + delete app/api/chat/workflow/route.ts. Verified on preview: authenticated POST /api/chat → 200 SSE stream; /api/chat/workflow → 404.
  • (Earlier test items #632/#634/#635 already on main via api#643.)

Summary by cubic

Promotes the chat streaming endpoint rename to prod: /api/chat/workflow is removed and replaced by POST /api/chat (delegates to handleChatWorkflowStream). Adds route tests and CORS OPTIONS; consumers on the old path will 404.

  • Migration
    • Ensure open-agents and chat clients use POST /api/chat; deploy them first.
    • Merge this PR during the cutover window to drop /api/chat/workflow.
    • Smoke-test: POST /api/chat streams 200; POST /api/chat/workflow returns 404.
    • External API-key callers must update to /api/chat (no alias).

Summary by CodeRabbit

  • Documentation
    • Updated API endpoint documentation to clarify the canonical path for the chat agent loop and confirm backward compatibility of the alternative endpoint path during client migration.