fix(core): Advertise completed task revival - #7454
Conversation
E2E Test ReportEnvironment: macOS, Node.js v24.18.0, Qwen Code 0.20.0, Scenario: Asked the model, without permitting Before: The globally installed 0.20.0 build answered No, cited only the "running background task" wording, and made zero tool calls. After: The patched local bundle answered Yes, cited "completed tasks are revived," and made zero tool calls. Automated verification: 2 test files passed (81 tests); full build, full typecheck, targeted ESLint, and |
|
Thanks for the PR! Template looks good ✓ Problem: observed bug with clear reproduction — issue #7450 documents the agent answering "No" when asked whether Direction: aligned. The deferred-tool summary truncation at 160 chars is a real information boundary — if the revival capability isn't visible there, the agent genuinely doesn't know about it until Size: 2 production lines (description text in Approach: the scope is exactly right — reword the first sentence to front-load the revival guidance within the 160-char window, plus a regression test that renders the real tool metadata through the actual truncation path. I verified independently: the old description's first 160 chars contain no "completed" mention; the new one includes both "completed background task" and "completed tasks are revived." Nothing to cut. Moving on to code review. 🔍 中文说明感谢贡献! 模板完整 ✓ 问题:已观测到的 bug,有明确复现——issue #7450 记录了 agent 在被问及 方向:对齐。deferred-tool 摘要在 160 字符处截断是一个真实的信息边界——如果唤醒能力在其中不可见,agent 在调用 规模:2 行生产代码( 方案:范围恰好——重写第一句话,将唤醒说明前置到 160 字符窗口内,加上一个回归测试,用真实工具元数据经过实际截断路径渲染。我独立验证了:旧描述的前 160 字符不含任何"completed"字样;新描述包含"completed background task"和"completed tasks are revived"。没有可砍的部分。 进入代码审查 🔍 — Qwen Code · qwen3.7-max Reviewed at |
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 ReviewIndependent proposal: reword the first sentence of the Comparison: the PR does exactly this. The description change is one line — "running background task" becomes "running, paused, or completed background task" with "; completed tasks are revived" appended. The test instantiates a real No blockers found. Conventions followed (collocated test, vitest, ESM imports, no Real-Scenario TestingUnit tests: 64/64 passed in Before (installed qwen 0.20.0)After (this PR via
|
|
Confidence: 5/5 — clean across every stage; would merge without hesitation. The problem is real and well-documented: the 160-char deferred-tool summary truncated the 中文说明置信度:5/5 —— 每个阶段都干净;毫不犹豫地合并。 问题是真实且有充分记录的:160 字符的 deferred-tool 摘要在任何关于已完成任务唤醒的说明之前截断了 — Qwen Code · qwen3.7-max Reviewed at |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
LGTM, looks ready to ship. ✅
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
— qwen3.7-max via Qwen Code /review
✅ Local runtime verification — PR #7454TL;DR: Verified end-to-end against a real Qwen Code What the PR does
How I verified — 3 independent layers1. Deterministic probe over real production code. Drove the real
2. Real CLI on the wire. Launched the actual 3. Unit‑test teeth. The PR's new regression test passes with the fix and fails when the prod fix is reverted (test kept) — Notes / scope
Harness (for reproducibility)Mock OpenAI server records the exact request body · real bundled CLI drives one headless turn · A/B by (a) src edit + 中文说明(点击展开)✅ 本地真实运行验证 — PR #7454结论: 已针对真实的 Qwen Code 此 PR 的作用
验证方式 —— 3 个相互独立的层次1. 基于真实生产代码的确定性探针。 用真实的
2. 真实 CLI 的线上请求。 用真实的 3. 测试的“咬合力”。 PR 新增的回归测试在有修复时通过;把生产代码的修复回退(保留该测试)后会失败 —— 说明 / 范围
验证工装(便于复现)mock OpenAI 服务记录真实请求体 · 真实打包 CLI 驱动一轮无头对话 · A/B 方式:(a) 改源码 + |


What this PR does
This PR makes the initially visible
send_messagesummary state that running, paused, and completed background tasks are supported and that completed tasks are revived. It also adds a regression test that renders the real tool metadata through the deferred-tool summary limit and verifies that the completed-task guidance remains visible.Why it's needed
The full tool schema already documented completed-task revival, and the runtime already implemented it, but deferred tools expose only the first 160 characters of their descriptions at session startup. The revival guidance appeared after that boundary, so an agent that had not called
tool_searchcould incorrectly conclude that completed subagents could not be reused and launch a redundant replacement. Keeping the capability in the initial summary lets the agent reuse prior context without an avoidable discovery round trip.Reviewer Test Plan
How to verify
Start a fresh session where
send_messageis deferred and ask, without allowingtool_searchor another tool call, whethersend_messagecan revive a completed background task. Confirm that the initial summary explicitly includes completed background tasks and states that completed tasks are revived, and that the model answers yes without launching a replacement agent.Evidence (Before & After)
Before: Qwen Code 0.20.0 answered No with zero tool calls and cited the visible summary's wording that only mentioned a "running background task."
After: the patched local bundle answered Yes with zero tool calls and cited: "running, paused, or completed background task ... completed tasks are revived."
Tested on
Environment (optional)
Local bundle in safe mode, Node.js v24.18.0, Qwen Code 0.20.0, model
qwen3.8-max-preview.Risk & Scope
tool_search.Linked Issues
Fixes #7450
中文说明
此 PR 的改动
此 PR 让初始可见的
send_message摘要明确说明其支持运行中、暂停和已完成的后台任务,并说明已完成任务会被唤醒。同时新增回归测试,将真实工具元数据经过 deferred-tool 摘要长度限制渲染,并验证已完成任务的说明仍然可见。为什么需要此改动
完整工具 schema 已经说明了已完成任务可被唤醒,运行时也已经实现该能力,但 deferred 工具在会话启动时只暴露描述的前 160 个字符。原先唤醒能力的说明位于该边界之后,因此尚未调用
tool_search的 agent 可能错误地认为已完成的子代理无法复用,并启动一个冗余的新代理。把该能力放入初始摘要后,agent 可以直接复用之前的上下文,不再需要一次可避免的工具发现往返。Reviewer 测试计划
验证方法
启动一个
send_message仍为 deferred 工具的新会话,在不允许调用tool_search或其他工具的情况下,询问send_message是否能唤醒已完成的后台任务。确认初始摘要明确包含已完成的后台任务并说明已完成任务会被唤醒,同时模型回答“可以”且不会启动替代代理。证据(修复前后)
修复前:Qwen Code 0.20.0 在零工具调用下回答 No,并引用了只提到“running background task”的可见摘要。
修复后:本地修复 bundle 在零工具调用下回答 Yes,并引用了“running, paused, or completed background task ... completed tasks are revived”。
测试平台
环境(可选)
本地 bundle safe mode、Node.js v24.18.0、Qwen Code 0.20.0、模型
qwen3.8-max-preview。风险与范围
tool_search获取。关联 Issue
Fixes #7450