Revert "fix(core): parse tagged Qwen3 thinking in default provider" - #6767
Conversation
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
This revert is missing the required PR template. The body just says "Reverts #6751" without any of the required sections — no "What this PR does", "Why it's needed", "Reviewer Test Plan", or "Risk & Scope".
More importantly, no reason is given for why this revert is needed. PR #6751 was merged just hours ago and fixed a real, reported bug (#6666 — <think> tags leaking into visible output for Qwen3 models). Before reverting a fix that another contributor authored, please explain:
- What went wrong — did #6751 cause a regression? Which scenario breaks?
- Why revert instead of fix forward — is there a narrower fix that preserves the #6666 fix while addressing the new issue?
A revert without context is hard to evaluate. Please fill out the template so reviewers can understand what problem this solves.
See the PR template.
中文说明
这个 revert PR 缺少必需的 PR 模板。正文只有 "Reverts #6751",没有任何必需章节——没有 "做了什么"、"为什么需要"、"审查测试计划" 或 "风险与范围"。
更重要的是,没有说明为什么需要 revert。PR #6751 几小时前刚合并,修复了一个已报告的 bug(#6666——Qwen3 模型的 <think> 标签泄露到可见输出中)。在 revert 另一位贡献者的修复之前,请解释:
没有上下文的 revert 很难评估。请填写模板,让审查者能理解这个 PR 解决了什么问题。
参考 PR 模板。
— Qwen Code · qwen3.7-max
|
@qwen-code /triage |
|
Thanks for the PR! Template looks good ✓ Problem: This is a revert of #6751, which was a fix for the observed bug in #6666 (Qwen3 model leaking Direction: Targeted revert is the right call here. #6751's model-name matching changes behavior based on routing rather than response shape, which is fragile. The follow-up (#6754, currently open) takes the correct response-shape-based approach. Reverting the intermediate fix while the proper one lands is clean. Size: Core paths touched (3 files in Approach: Minimal and focused — this is exactly what a revert should look like. Three files, all directly related to the reverted change. The Moving on to code review. 🔍 中文说明感谢贡献! 模板完整 ✓ 问题:这是对 #6751 的 revert。#6751 是为修复 #6666(Qwen3 模型在 方向:定向 revert 是正确的选择。#6751 的模型名匹配基于路由而非 response shape 改变行为,这是脆弱的。后续修复(#6754,当前 open)采用了正确的 response-shape-based 方法。在正确修复落地前 revert 中间方案是干净的。 规模:触及核心路径( 方案:最小且聚焦——这正是 revert 应有的样子。三个文件都直接与被 revert 的变更相关。 进入代码审查 🔍 — Qwen Code · qwen3.7-max |
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
Code ReviewClean revert. The diff does exactly what the PR description says — removes The No correctness issues, no security concerns, no scope creep. Test ResultsApplied the PR's changes locally and ran all affected test suites: Real-Scenario TestingNot applicable for this revert. The behavior change (model-name-based tagged-thinking parsing) only manifests when talking to a live Qwen3 API endpoint that returns LGTM on code review. Moving to final assessment. 🔍 中文说明代码审查干净的 revert。diff 完全如 PR 描述所述——从
无正确性问题,无安全隐患,无范围蔓延。 测试结果在本地应用 PR 的变更并运行所有相关测试套件: 真实场景测试不适用于此 revert。行为变更(基于模型名的 tagged-thinking parsing)仅在与返回 代码审查通过。进入最终评估。🔍 — Qwen Code · qwen3.7-max |
|
This is a clean, well-motivated revert. The author correctly identified that #6751's model-name-based approach to tagged-thinking parsing was at the wrong abstraction layer — it changed behavior based on routing/model naming rather than the actual response shape. The real fix is in #6754 (response-shape-based retry), and this revert clears the way for it. The diff is exactly what a revert should be: minimal, focused, no drive-by changes. Every line removed traces directly back to #6751. The No reservations. Ships it. ✅ 中文说明这是一个干净、动机明确的 revert。作者正确识别了 #6751 基于模型名的 tagged-thinking parsing 方法处于错误的抽象层——它根据路由/模型命名而非实际 response shape 改变行为。真正的修复在 #6754(基于 response shape 的 retry),这个 revert 为其让路。 diff 正是 revert 应有的样子:最小化、聚焦、无顺手改动。每一行删除都可追溯到 #6751。 无顾虑。可以合并。✅ — Qwen Code · qwen3.7-max |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
LGTM, looks ready to ship. ✅
|
Addressed the review feedback:
|
Reverts #6751.
What this PR does
This PR reverts the Qwen3 model-name based tagged-thinking parser gate that was added in #6751.
Why it's needed
#6751 enabled tagged-thinking response parsing for default OpenAI-compatible provider responses when the model name matches Qwen3. After checking the real failing traces for #6666, that fix is at the wrong abstraction layer.
What went wrong: the observed failure is not simply "Qwen3 returned a complete
<think>...</think>block incontent." In the real cases, the stream had already produced structured reasoning / thought content, but raw<think>/</think>fragments still leaked into visible content. That means the streamed response itself is malformed: the reasoning channel and visible-content channel were mixed.Why revert instead of fixing forward in the same direction: matching
qwen3in the model name changes behavior based on routing/model naming rather than the actual response shape. It can also parse or hide literal user-visible<think>...</think>text for all Qwen3-compatible endpoints, and it does not reliably handle malformed streams with bare closing tags, split tag fragments, or tool calls emitted in the same bad attempt.The follow-up fix should be response-shape based: when structured reasoning is already present and visible content contains raw thinking-tag fragments, drop that malformed attempt and retry instead of accepting or cleaning the corrupted content. That follow-up is handled separately in #6754.
Reviewer Test Plan
How to verify
Review that this PR only reverts #6751 and restores the default provider behavior before the model-name based parser gate was added.
Evidence (Before & After)
Before: #6751 made Qwen3 model-name matching opt the default OpenAI-compatible provider into tagged-thinking parsing.
After: the default provider no longer changes response parsing behavior based on a Qwen3 model-name match. The malformed-stream handling is left to #6754, where the condition is based on the actual response shape.
Tested on
Environment (optional)
N/A — this PR is a targeted revert of #6751.
Risk & Scope
Linked Issues
Related to #6666.
Related to #6754.
中文说明
Reverts #6751.
What this PR does
这个 PR revert 了 #6751 中新增的、基于 Qwen3 模型名启用 tagged-thinking parser 的逻辑。
Why it's needed
#6751 在默认 OpenAI-compatible provider 中,当模型名匹配 Qwen3 时启用 tagged-thinking response parsing。检查 #6666 的真实失败 trace 后,这个修复位于错误的抽象层。
出了什么问题:真实失败并不只是“Qwen3 在
content里返回了一段完整的<think>...</think>block”。真实 case 里,stream 已经产生了 structured reasoning / thought 内容,但 raw<think>/</think>片段仍然泄漏到了 visible content。也就是说,这条 streamed response 本身是 malformed 的:reasoning channel 和 visible-content channel 混在了一起。为什么 revert,而不是沿着同一个方向继续修:按模型名匹配
qwen3会根据路由/模型命名改变行为,而不是根据实际 response shape 判断。它也可能把所有 Qwen3-compatible endpoint 中用户本来可见的 literal<think>...</think>文本解析或隐藏掉,而且无法可靠处理裸 closing tag、split tag fragment,或者同一个坏 attempt 中同时出现 tool call 的 malformed stream。后续正确修复应该基于 response shape:当 structured reasoning 已经存在、但 visible content 又包含 raw thinking-tag fragment 时,应该丢弃这次 malformed attempt 并 retry,而不是接受或清洗这段损坏内容。这个后续修复在 #6754 中单独处理。
Reviewer Test Plan
How to verify
确认这个 PR 只 revert #6751,并恢复新增 model-name based parser gate 之前的 default provider 行为。
Evidence (Before & After)
Before:#6751 让默认 OpenAI-compatible provider 在 Qwen3 模型名匹配时启用 tagged-thinking parsing。
After:default provider 不再基于 Qwen3 模型名改变 response parsing 行为。malformed-stream 的处理留给 #6754,由实际 response shape 决定。
Tested on
Environment (optional)
N/A — 这个 PR 是对 #6751 的定向 revert。
Risk & Scope
Linked Issues
Related to #6666.
Related to #6754.