Conversation
Backend changes: - Create LLM before graph compilation for proper streaming interception - Change react config from COMPONENT (subgraph) to direct LLM+TOOL nodes - Make build_graph async in all components to enable pre-creation of LLM - Skip final AIMessage only when buffer has content (fix deep research) - Move node transition detection before AIMessage skip check - Access messages directly from state to preserve BaseMessage types Frontend changes: - Fix duplicate detection in streaming_chunk handler (condition was inverted) Co-Authored-By: Claude <noreply@anthropic.com>
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves streaming functionality by fixing duplicate content detection and enabling proper token-by-token streaming through LangGraph's messages mode.
Changes:
- Fixed duplicate content detection logic in the frontend to correctly identify when backend sends full content after incremental streaming
- Refactored graph builder and components to create LLM instances before graph compilation, enabling proper streaming interception
- Added
celery-typesdependency for better type safety with Celery tasks - Restructured ReAct agent from component-based to direct LLM+TOOL nodes for improved streaming support
Reviewed changes
Copilot reviewed 10 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| web/src/store/slices/chatSlice.ts | Improved duplicate content detection logic and added debug logging for streaming events |
| service/app/core/chat/langchain.py | Refactored message streaming to clear buffer on node transitions and skip final AIMessage when streaming is active |
| service/app/api/ws/v1/chat.py | Removed type ignore comment now that celery-types provides proper type hints |
| service/app/agents/graph_builder.py | Made build() and node builders async to create LLM before compilation; components now return compiled graphs directly |
| service/app/agents/factory.py | Added streaming: True flag to LLM model kwargs to enable token-by-token output |
| service/app/agents/components/react.py | Made build_graph async and moved LLM creation before graph compilation |
| service/app/agents/components/executable.py | Updated build_graph signature to async with documentation explaining the requirement |
| service/app/agents/components/deep_research/components.py | Updated all component build_graph methods to async |
| service/app/agents/builtin/react.py | Restructured from component-based to direct LLM+TOOL nodes for better streaming |
| service/pyproject.toml | Added celery-types>=0.24.0 dependency |
| service/uv.lock | Added celery-types package lock entries |
| .gitignore | Added .claude/ directory to ignore list |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Mile-Away
approved these changes
Jan 19, 2026
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.
变更内容
简要描述本次 PR 的主要变更内容。
相关 Issue
请关联相关 Issue(如有):#编号
检查清单
默认已勾选,如不满足,请检查。
其他说明
如有特殊说明或注意事项,请补充。