fix(core): clarify list_agents excludes Agent Team teammates - #9432
Conversation
The empty list_agents result ("No background agents are available in
this session") is true for the ordinary background-subagent roster but
reads as team status while named Agent Team teammates are active, which
can trigger duplicate launches or a false "no workers running"
conclusion.
Make the control-plane boundary explicit:
- tool description states that named teammates are NOT listed, deliver
their final reports automatically, and that list_agents/task_list
polling must not be used to wait for them;
- empty result names the roster it reports on and the teammate
exclusion.
The registries stay separate; this is a tool-contract wording fix only.
Fixes #9431
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
Thanks @yiliang114! The change itself reads fine — prose-only, tightly scoped, and it matches what #9431 asked for. But the PR body skips the PR template, so I have to pause it here.
What's missing:
## What this PR doesand## Why it's needed— the content is already there under## What changed?; it just needs the template headings (the #9431 ambiguity problem is theWhy it's neededpart)## Reviewer Test Plan— your## Verificationnotes fit under### How to verify;### Evidence (Before & After)can beN/Afor a prose-only change, and the### Tested ontable needs filling in## Risk & Scope— trivial for this one, but the section is required## Linked Issues—Fixes #9431goes here- The bilingual
<details>translation
Your recent PRs (#9367, #9364) follow this exact shape, so it should be a quick copy-over. Once the body is updated, re-run with @qwen-code /triage.
中文说明
感谢 @yiliang114!改动本身没问题——纯文案、范围收敛,也和 #9431 的诉求一致。但 PR 描述没有使用 PR 模板,所以先停在这里。
缺失内容:
## What this PR does和## Why it's needed—— 内容已经在## What changed?里了,换成模板标题即可(#9431 的歧义问题就是Why it's needed部分)## Reviewer Test Plan——## Verification里的内容放到### How to verify;纯文案改动### Evidence (Before & After)可写N/A,### Tested on表格需要填写## Risk & Scope—— 对这个 PR 来说很简单,但该章节是必需的## Linked Issues——Fixes #9431放这里- 双语
<details>翻译
你最近的 PR(#9367、#9364)就是这个格式,照搬即可。更新 PR 描述后用 @qwen-code /triage 重新触发。
— Qwen Code · qwen3.8-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. |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
Reviewed — no blockers. Suggestions are inline. 1 Suggestion-level finding(s) could not be anchored to a changed line and were dropped; nothing further to act on here.
— qwen3.8-max via Qwen Code /review (v0.21.13)
doudouOUC
left a comment
There was a problem hiding this comment.
Not reviewed: coverage — no plan was given, so this run cannot show that any of the diff was read.
— qwen3.8-max via Qwen Code /review (v0.21.13)
doudouOUC
left a comment
There was a problem hiding this comment.
Two-stage review summary for PR #9432
Round 1: deepseek-v4-flash found issues → stopped after one pass.
Findings
-
Suggestion —
packages/core/src/tools/list-agents.ts:55
The Agent Team disclaimer is repeated in both the empty-state message and the tool description with slightly different wording ("team messaging" vs "team lifecycle"). Extracting the shared warning into a single constant would prevent the two copies from drifting out of sync in future edits. -
Noted (not posted inline) —
getDescription()string is not covered by the updated tests. This overlaps with the suggestion above and is left as an author judgment call.
A review with 1 inline suggestion has already been posted by the review agent.
|
@qwen-code /review |
|
Qwen Code review request accepted. Review is queued in workflow run. |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
Reviewed — no blockers. Suggestions are inline.
Deferred under the convergence posture (round 2, not a blocker) — recorded, not requested in this round:
packages/core/src/tools/list-agents.ts:83 — [probe] 'Teammates are NOT listed here' contract is guarded only by spawn-path separation — no tool code or behavioral test excludes teammates from the rosterpackages/core/src/tools/list-agents.ts:85 — [review] 'deliver their final reports automatically' is false for FAILED/CANCELLED teammate exits — paired with the never-poll instruction, a silently failed teammate may never be followed uppackages/core/src/tools/list-agents.ts:31 — [review] Non-empty returnDisplay still says 'background agents' — the one surface left ambiguous by the PR's partial terminology rename, pinned by no test
— qwen3.8-max via Qwen Code /review (v0.21.13)
|
@qwen-code /triage |
|
Sandboxed verification: The verification job did not complete (checkout, runner, or setup error) and produced no report. See the workflow run for details. 中文 — 判定:
|
|
@qwen-code /triage |
|
Sandboxed verification: The verification job did not complete (checkout, runner, or setup error) and produced no report. See the workflow run for details. 中文 — 判定:
|
|
Triage re-ran on the new head — still no new review, because the gate state hasn't changed.
To move forward: put the PR body on the template headings — the substance is already there under 中文说明在新 head 上重新执行了 triage —— 仍然没有提交新评审,因为门控状态没有变化。
推进方式:把 PR 描述换成模板标题即可 —— 实质内容在 |
|
@qwen-code /triage |
|
Sandboxed verification: The verification job did not complete (checkout, runner, or setup error) and produced no report. See the workflow run for details. 中文 — 判定:
|
|
Triage re-run completed without a new review.
The stage comments above were updated with the latest result. View workflow run. 上方各阶段评论已更新为最新结果。查看工作流运行。 |
doudouOUC
left a comment
There was a problem hiding this comment.
Review: APPROVE ✅
Independent verification at head 1d60403.
Scope — tool-contract wording only: getDescription(), the empty-roster message, and the tool description now state that named Agent Team teammates are not listed and deliver results via team messaging. No registry/runtime behavior changes.
Verified
- The new test assertions match the shipped strings exactly — the empty-roster message and all three description substrings (
Named Agent Team teammates are NOT listed here,deliver their final reports automatically,do not use list_agents (or poll task_list) to wait for a teammate) are present in the description. - No stale consumers remain: grepping
packages/for the previous strings (No background agents are available,List background agents) returns nothing, so no other caller or test breaks. - Functional CI is green (only the
review-prbot workflow is pending, which is orthogonal to merge-readiness).
Non-blocking (deferred by author, agreed) — the getDescription() unit assertion and unifying the disclaimer/description wording into a shared constant are reasonable follow-ups; per house rules a missing test for already-correct behavior is a Suggestion, not a blocker.
LGTM.
|
@qwen-code /triage PR body updated to match the template. |
|
Sandboxed verification: The verification job did not complete (checkout, runner, or setup error) and produced no report. See the workflow run for details. 中文 — 判定:
|
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
LGTM — prose-only tool-contract fix, no registry/runtime behavior changes. Remaining findings are Suggestion-level and deferred by the author as follow-ups. Functional CI green.
|
The template is in place now, so the gate can actually read this one. ✅
Moving on to code review. 🔍 中文说明模板已补齐,gate 可以正常评估了。✅
进入代码审查。🔍 — Qwen Code · qwen3.8-max Reviewed at |
Code reviewThe change does what the issue asked and matches my independent proposal for #9431: prose updates on the three named surfaces, with tests pinning the new strings. What I verified:
Non-blocking, already in the /review ledger and deferred by the author as follow-ups (agreed — none of them block a wording fix):
Test evidence — the PR's own CI on the reviewed commit
No behavioural claim to settle here — this is a wording-only change and the unit suite pins the new strings, so no sandboxed 中文说明代码审查改动与 issue 要求一致,也与我对 #9431 的独立方案相同:在三处指定位置更新措辞,并用测试固定新字符串。已核实:
非阻塞项(/review 已记录,作者确认为延后跟进,均不阻塞措辞修正):非空 测试证据 —— 该 commit 的 PR 自身 CI
— Qwen Code · qwen3.8-max Reviewed at |
|
Confidence: 4/5 — clean, minimal, issue-backed wording fix; only the three deferred Suggestion-level follow-ups remain. This one held up under the gate. The template round-trip was worth it — the body now names the problem, the surfaces being changed, and the deferred items explicitly, which made this pass quick. The diff does exactly what #9431 asked: three prose surfaces, tests pinning the new contract, nothing else. My independent proposal for the issue was the same change, and I found no simpler path — the empty-roster message, the tool description, and the invocation description are precisely the three places a model reads this contract. The open items (old terminology in the non-empty Verdict: approve. The approval is already pinned to this exact commit from the prior pass ( 中文说明置信度:4/5 —— 干净、最小、有 issue 支撑的措辞修正;只剩三条已延后的 Suggestion 级跟进项。 复盘:模板往返是值得的——PR 正文现在清楚写明了问题、改动面和延后项,让这一轮审查很快。diff 完全按 #9431 执行:三处措辞、固定新契约的测试、没有其他内容。我对该 issue 的独立方案与此相同,没有更简路径——空名册消息、工具描述、调用描述正是模型读取该契约的三处。 遗留项(非空 returnDisplay 的旧术语、失败/取消 teammate 的"自动送达"措辞、缺失的 getDescription 断言)真实存在但均为 Suggestion 级,作者(维护者)已在 PR 正文中明确延后跟进。无阻塞项。 结论:通过。该 commit 上一轮已固定批准( — Qwen Code · qwen3.8-max Reviewed at |
|
Released in v0.21.15. |
What this PR does
list_agentslists only the ordinary background-subagent roster, but neither the tool description nor the empty result said that named Agent Team teammates are excluded. This PR makes that control-plane boundary explicit across three surfaces: the tool description, the empty-roster message, and the invocation description (getDescription()). It is a tool-contract wording fix only — the ordinary background-agent registry and the Agent Team runtime stay separate.Why it's needed
While a team is active, an empty
list_agentsresult reads like team status and can lead to duplicate launches or a false "no workers running" conclusion. Naming the boundary — that named Agent Team teammates are NOT listed here and deliver their final reports automatically through team messaging — prevents callers from usinglist_agents(or pollingtask_list) to wait for a teammate.Reviewer Test Plan
How to verify
vitest run src/tools/list-agents.test.ts— 3/3 passed (updated empty-roster expectation + new description-boundary assertions)prettier --checkandeslintclean on both changed filesEvidence (Before & After)
N/A — non-user-visible tool-contract wording change.
Tested on
Environment (optional)
N/A — unit tests only.
Risk & Scope
packages/core/src/tools/list-agents.tsand its test; no registry or Agent Team runtime behavior changes.getDescription()string (deferred follow-up).Linked Issues
Fixes #9431
中文说明
这个 PR 做了什么
list_agents只列出普通的后台子代理名单,但工具描述和空结果都没有说明命名 Agent Team 队友是被排除在外的。本 PR 把这个控制面边界在三处说清楚:工具描述、空名单消息、以及调用描述(getDescription())。这仅是工具契约的措辞修正——普通后台代理注册表与 Agent Team 运行时保持分离。为什么需要
当团队处于活跃状态时,空的
list_agents结果读起来像团队状态,可能导致重复启动,或误判为"没有 worker 在运行"。把这个边界写明——命名 Agent Team 队友不会出现在这里、其结果会通过团队消息自动送达——可以避免调用方用list_agents(或轮询task_list)来等待某个队友。评审人验证计划
如何验证
vitest run src/tools/list-agents.test.ts— 3/3 通过(更新了空名单断言 + 新增描述边界断言)prettier --check与eslint在两个改动文件上均通过证据(改前 & 改后)
N/A —— 非用户可见的工具契约措辞变更。
测试环境
运行环境(可选)
N/A —— 仅单元测试。
风险与范围
packages/core/src/tools/list-agents.ts及其测试做措辞修改;不改变注册表或 Agent Team 运行时行为。getDescription()字符串补单元断言(延后跟进)。关联 Issue
Fixes #9431