Promote test → main: remove legacy /api/chat endpoint (#632)
Merged
SW
5mo ago+26+26+01234567890123456789-1435-1435-0123456789012345678901234567890123456789
Promotes test → main. Brings 5 commits forward; headline change is the legacy chat endpoint removal.
Included
- #632 — remove legacy
POST /api/chatstreaming endpoint + dead handlers (handleChatStream,handleChatCompletion,handleSendEmailToolOutputs) and orphaned code (extractSendEmailResults,lib/messages/validateMessages,upsertMemory,getLatestUserMessageText). Net +26/−1435. - #635 — migrate research provider to SongStats (already on main via prior merges; carried in test's merge commits)
- #634 — credit-spend visibility digest cron (already on main via #637; carried in merge commits)
Verification (#632)
- Local: lint clean, 692 tests pass.
- Preview E2E:
POST /api/chat→ 404 (removed);/api/chat/workflow,/api/chat/generate,/api/chatsall respond 400/401 (alive, graphs intact after deletions).
Advances cleanup tracker recoupable/chat#1767.
Summary by cubic
Removes the legacy POST /api/chat streaming endpoint and deletes its unused handlers and tests to simplify the chat surface. Active chat routes (/api/chat/workflow, /api/chat/generate) remain unchanged.
-
Refactors
- Deleted
app/api/chat/route.tsand legacy handlers (handleChatStream,handleChatCompletion). - Removed email tool wiring (
handleSendEmailToolOutputs,extractSendEmailResults) and dead helpers (lib/messages/validateMessagesduplicate,getLatestUserMessageText,upsertMemory). - Trimmed chat integration tests to cover validate/setup/credits; minor comment updates in
validateChatRequestandhandleChatCredits.
- Deleted
-
Migration
- Stop calling
POST /api/chat. - Use
POST /api/chat/workflowfor tool-driven flows orPOST /api/chat/generatefor text generation.
- Stop calling