Feat/chat routing chain rewrite#6
Merged
sylvanding merged 6 commits intomainfrom Mar 12, 2026
Merged
Conversation
… rewrite Comprehensive planning documents for migrating chat message routing from custom SSE + monolithic _stream_chat to Vercel AI SDK 5.0 Data Stream Protocol + LangGraph StateGraph pipeline. Made-with: Cursor
Backend: LangGraph StateGraph with 6 nodes (understand, retrieve, rank, clean, generate, persist) emitting Data Stream Protocol events via get_stream_writer(). New /stream/v2 endpoint runs alongside existing /stream for gradual migration. Frontend: Vercel AI SDK 5.0 useChat hook with custom transport, OmeletteUIMessage types, useChatStream wrapper, and MessageBubbleV2 component rendering UIMessage.parts. PlaygroundPage rewritten to eliminate manual SSE parsing and 15+ useState/useRef. Made-with: Cursor
…dd pipeline tests - Remove legacy _stream_chat and helpers (TOOL_MODE_PROMPTS, _clean_excerpt, etc.) - Promote /stream/v2 to /stream as the sole chat endpoint - Initialize LLM/RAG services at endpoint layer for proper config sharing - Remove streamChat from frontend chat-api.ts (replaced by AI SDK transport) - Update transport URL from /stream/v2 to /stream - Add 23 tests: stream_writer formatting, ChatState types, graph compilation, config helpers, and 3 endpoint integration tests - Simplify test_chat.py to only cover Conversation CRUD Made-with: Cursor
Prevents React duplicate key warning when multiple thinking steps share the same step name (e.g. two "understand" events). Made-with: Cursor
Made-with: Cursor
Documents the full chat message routing chain rewrite: problem symptoms, root cause, LangGraph + AI SDK 5.0 solution architecture, 5 implementation pitfalls encountered, and prevention strategies. Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.