Repository navigation
fix: prioritize content over reasoning_content when both are in same SSE delta - #46
Merged
Merged
Conversation
…SSE delta kimi-k2.7-code through realapi-aliyun sends SSE chunks where both 'content' and 'reasoning_content' are non-empty in the same delta. parse_sse_chunk checked reasoning_content first and returned early, silently dropping the visible text content — the user saw only fragments like '你的吗?' instead of the full response. Fix: check content BEFORE reasoning_content so visible text is never dropped. The reasoning tail fragment in the mixed chunk is lost, which is acceptable since it's typically just the last few words of a sentence already captured in earlier chunks.
fgclaw01
force-pushed
the
fix/minimax-thinking-disable
branch
from
July 27, 2026 02:31
6baa2ef to
63c7bdb
Compare
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.
Problem
kimi-k2.7-code through realapi-aliyun sends SSE chunks where both
contentandreasoning_contentare non-empty in the same delta:{"delta":{"content":"你好!很高兴见到你。有什么我可以帮", "reasoning_content":" them and asking how I can help."}}parse_sse_chunkcheckedreasoning_contentfirst and returned early, silently dropping the visible text content. The user saw only fragments like "你的吗?" instead of the full response.Fix
Swap the check order:
contentbeforereasoning_content. The reasoning tail fragment in the mixed chunk is lost (typically just the last few words already captured in earlier chunks), but visible text is never dropped.Verification
Python simulation against live realapi-aliyun API:
''(dropped entirely) or'你的吗?'(fragment)'你好!很高兴见到你,有什么我可以帮你的吗?'✅Changes
agent/src/llm/helpers.rs: swapcontentcheck beforereasoning_contentcheck inparse_sse_chunkcontent_before_reasoning_when_both_present