feat(chat): repoint chat transport to canonical POST /api/chat

Merged
SW
6mo ago
+3-3

Step 3 of the /api/chat/workflow → /api/chat rename (chat#1767).

useChatTransport now POSTs to ${baseUrl}/api/chat (was /api/chat/workflow), against the canonical endpoint added in api#645 and documented in docs#235.

Changes

  • hooks/useChatTransport.ts — transport api: → /api/chat (+ docstring)
  • providers/VercelChatProvider.tsx — comment-only ref updated

⚠️ Deploy coordination (critical)

api#645 deletes /api/chat/workflow (no alias). This PR and api#645's promotion to prod, plus the open-agents repoint (step 4), must deploy in the same window:

  • If chat deploys before api prod has /api/chat → chat 404s.
  • If api prod removes /workflow before chat deploys this → chat 404s.

Verification

  • No /api/chat/workflow refs remain in chat; tsc + lint clean.
  • E2E on preview after deploy: send a chat → DevTools shows the transport POSTing /api/chat (200, streams). (No unit test — single transport URL string in a hook with no existing test infra.)

Follow-up

  1. open-agents — repoint CHAT_API_POST_PATH → /api/chat

Summary by cubic

Switched chat transport to POST to ${baseUrl}/api/chat (was /api/chat/workflow). Aligns with the canonical API and prevents 404s when the old endpoint is removed.

  • Migration
    • Requires api#645 to be live; deploy chat and API together to avoid 404s.
    • Follow-up: repoint open-agents CHAT_API_POST_PATH to /api/chat.