Skip to content

Fix: Send reasoning and tool tags as frames of their own - #136

Merged
b-re-w merged 1 commit into
developfrom
work/think-frames
Oct 3, 2026
Merged

b-re-w merged 1 commit into
developfrom
work/think-frames

Conversation

@b-re-w

@b-re-w b-re-w commented Oct 3, 2026

Copy link
Copy Markdown
Member

#112 (SPEC S1.4).

Defect fixed: confirmed with Qwen3-0.6B's tokenizer (no model run): TextIteratorStreamer on the one-at-a-time path emits '<think>\n' and '</think>\n\n', so the app's exact <think>/</think> match failed. BaseModel.chat now 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

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
b-re-w force-pushed the work/think-frames branch from d5de38e to ac25864 Compare October 3, 2026 06:12
@b-re-w
b-re-w merged commit b6920ab into develop Oct 3, 2026
4 checks passed
@b-re-w
b-re-w deleted the work/think-frames branch October 3, 2026 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant