Issues / #1814

#1814 Model writing a literal </think> emits the special token: quoted tag ends the reasoning mid-sentence and the turn stops (finish_reason=stop)

open · @danirebollo · 2 コメント · GitHub で見る

BenchmarksServer & APIModels & quants

本文

Follow-up on the output side of #537. On 0.1.41 (Qwen3.8-Flash-Next IQ3_XXS, 2×3090), a long agent session about parsing </think> had 4 turns in a row cut after 100–200 tokens with finish_reason: stop, right after a backtick in the reasoning.
What I changed in serve/ (patch attached):
Only the model's own end-of-thinking token closes the thinking. Service.run() now tells the parser when it is that token, so a </think> the model writes with ordinary text tokens stays reasoning text.A special <think>/</think> token that can't be a real marker is swapped for the tag's text tokens, and generation continues. That covers the answer, and quoted or mid-line tags in the thinking. It reuses the #123 continuation path.If the model stops right after opening an inline code span in its thinking, the tag is written as text and generation continues.
It's capped at 64 swaps per reply, behind a literal_think_guard flag (on by default), with 12 new tests.
What worked for me: asking the model to write the tag, repeating answer: 42</think> and a tool result containing the tag now all give full reasoning and a correct answer. A prompt that returned no answer 2/6 times returned 0/3. Decode speed is unchanged (120.3 vs 120.4 tok/s).

関連リンク

インストール・モデル・リリースへの站内リンク。