Repository navigation
Fix: Send reasoning and tool tags as frames of their own - #136
Merged
Merged
Conversation
The app opens the reasoning panel only on a frame that is exactly <think> or </think>. On the one-at-a-time path TextIteratorStreamer emits at word boundaries, and with Qwen3's tokenizer the tags arrive as '<think>\n' and '</think>\n\n', so the panel never opened and the tags showed up in the answer. The model layer now splits every special tag into its own frame.
b-re-w
force-pushed
the
work/think-frames
branch
from
October 3, 2026 06:12
d5de38e to
ac25864
Compare
This was referenced Oct 3, 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.
#112 (SPEC S1.4).
Defect fixed: confirmed with Qwen3-0.6B's tokenizer (no model run):
TextIteratorStreameron the one-at-a-time path emits'<think>\n'and'</think>\n\n', so the app's exact<think>/</think>match failed.BaseModel.chatnow splits<think>,</think>,<tool_call>,</tool_call>into their own frames after tag buffering; the joined text is unchanged.Test added:
api/tests/test_think_frames.py(red: 2 failed).Closes #112