Repository navigation
[bug] Agent Teams 与直接委派共存:list_agents 同名冲突、wait_agent 语义错位(附可复现证据与补丁) #9523
Replies: 3 comments
补充:解耦方案(建议 B)已实现并推送上面的建议 A 是"严格按文档把直接委派关掉"。但那样会砍掉一半能力——同一个名字被两个语义不同的工具占用,更好的做法是把名字解开,两边都留着。按这个思路做了实现: 分支: 改了什么(12 文件 / +50 −47)
需要维护者注意
三个方案的关系
个人建议:B + C 的内容已包含在本分支;A 保留作为"严格按文档"的备选。 |
|
An out-of-tree plugin already holds the delegation half of this, and it was built on the same root cause you reached. Same diagnosis, independently. Runtime-plane equivalent of your fix A, with no core change:
# any profile / bundle layer
- insert:
- id: team-delegation-guard
name: '@argszero/cordis-plugin-team-delegation-guard'It keys on What it does not fix, measured against your three symptoms:
One note for the review of fix A, in case it gets simplified: keep the condition per row. The enclosing |
|
Thanks — that account of the mechanism is sharper than my report had it, and it settles the one observation I could not reconcile: why the duplicate I re-verified both structural claims against
On the review note for fix A: agreed, and the branch already does it per row. The condition lands on Where the guard and the two core branches sit
Two things I think are worth stating plainly, because they are policy rather than mechanism:
Cross-reference: #7642 reported the same root cause three weeks ago and covered the roster/reachability half ("dispatched someone and can neither find nor reach them"). This thread adds the Question for the maintainers: for the shipped Web profile, is the intended long-term policy exclusivity (A, with the guard as the out-of-tree stopgap) or coexistence (B)? That decides which branch is worth landing — both are small, both are on the fork, and neither needs anything beyond the four preset rows / the one tool name. Branches:
|
Uh oh!
There was an error while loading. Please reload this page.
[bug] 启用 Agent Teams 后直接委派没有被禁用(web preset 逃过 patch)→
list_agents同名冲突 +wait_agent语义错位摘要(TL;DR)
@deepseek-ai/dsh-experimental-agent-team-profile的文档承诺:但该层只按 id 禁用了根层的那几行;
packages/bundle/web-app/presets/*.patch.yml在各自的嵌套
plugins:列表里又声明了一遍同名 id 的行,那些是独立实例,patch 够不到。结果是Agent Teams 与直接委派同时生效:
list_agents;wait_agent(只观察 teammate)和subagent(直接委派的后台子代理)并存,模型用wait_agent等普通子智能体时永远拿到noProgress: no-active-peer;「没有子智能体」,进一步误导。
环境
0.2.0-rc.2(npmlatest);同一问题在master(0.2.1-alpha.2)上依然存在web,dsh.profile.bundles含@deepseek-ai/dsh-base、@deepseek-ai/dsh-web-app、@deepseek-ai/dsh-experimental-agent-team-profile@deepseek-ai/dsh-experimental-agent-team-web-profile,启动时会报
cannot resolve profile bundle(该包已不存在,README 要求移除该条目)复现
subagent创建普通子智能体(或先spawn_teammate再改用subagent)wait_agent→ 无论 timeout 多长,立即返回:{"timedOut":false,"noProgress":{"reason":"no-active-peer", "message":"No other Team member is running or provisioning. wait_agent cannot make progress or wake inactive teammates. ..."}}list_agents→ 返回的是 teammate 花名册,看不到任何普通子智能体:[{"target":"lead","role":"lead","status":"running","model":"..."}, {"target":"repo-architect","role":"teammate","status":"running","provider":"spawn",...}]证据
1) 合成后的 profile:根层被禁用、preset 层没有
2) 实际会话日志(
~/.dsh/sessions/.../session.v4.jsonl.zstd)同一会话里
subagent调用 21 次(都成功返回started subagent <id>)、wait_agent调用 59 次(除开头 team 阶段外全部
no-active-peer),而子智能体的完成通知其实是通过source.kind: 'subagent-settled'推回来的(该会话共 24 条)。也就是说模型在空转。3) 上游源码
packages/experimental/agent-team-profile/cordis.patch.yml:4-14、packages/experimental/agent-team-profile/README.md("are disabled")packages/bundle/web-app/presets/standard.patch.yml:91-110、ptc.patch.yml:91-110、cordis.patch.yml:90-109packages/experimental/tool-agent-team/src/index.ts:233(teams 花名册)vs
packages/subagent/tool-subagent-control/src/list-agents.ts:87(子代理列表)wait_agent只观察 teammate:packages/experimental/tool-agent-team/src/index.ts:40(NO_ACTIVE_PEER_MESSAGE)packages/client/ui-conversation/src/client/locales.ts:263(zh) /:641(en)根因
agent-team-profile层的 patch 以根索引的 id 定位并禁用行(Cordis patch 的id 寻址不进入 preset 的嵌套
plugins:列表)。web-app 的三个 preset 各自声明了同一批 id 的新行,因此:
tool-subagent*被禁用 ✅(符合文档)tool-subagent*仍然激活 ❌(违反文档)于是
tool-agent-team(根层)与 preset 的tool-subagent-control/list-agents在同一个 agent 作用域里争用
list_agents这个名字,实际解析到 teams 版;与此同时
subagent/subagent_fork也仍然可用。建议修复
A(推荐,恢复文档承诺):preset 行跟随 teams bundle
在三个 preset 的直接委派行上加同一个条件(
!!js+ctx.get,与presets/cordis.patch.yml:145现有写法一致):覆盖
tool-subagent-control/tool-subagent-list-agents/tool-subagent/tool-subagent-fork,各 3 个 preset、共 12 行。teams bundle 关掉时这些行自动恢复。补丁:
dsh-agent-team-preset-delegation.patch(见文末)。B(若「两者共存」是有意设计):消除同名冲突
把 teams 的花名册工具从
list_agents改名(例如list_teammates),并同步POLICY 文本、文档、客户端引用与测试。这样
wait_agent与subagent可以共存,但需要维护者确认这是期望的产品形态——目前的文档说的是 A。
C(独立、无论 A/B 都建议修):
wait_agent的 noProgress 文案detail.wait.noProgress说的是「没有正在运行的子智能体」,而这条结果来自只观察team member 的
wait_agent。改成「没有正在运行的团队成员」/「No active teammates」。补丁:
dsh-agent-team-wait-label.patch。影响
wait_agent上反复空转(实测 59 次),浪费轮次与 token;
附:补丁
dsh-agent-team-preset-delegation.patch— 12 行 / 3 文件(建议 A)dsh-agent-team-wait-label.patch— 3 行 / 2 文件(建议 C)两者都基于
master,可直接git apply。注意: 提交者未执行仓库测试套件(需要 monorepo
pnpm install),仅做了 YAML 解析与 id/条件的存在性校验;建议 A 最好补一条 preset 级装配断言(
apps/cli/tests/web-agent-presets.e2e.ts的 harness 看起来正合适)。
English (for the issue body)
Summary
@deepseek-ai/dsh-experimental-agent-team-profiledocuments that ordinary subagentdelegation is disabled while Agent Teams is active. Its patch disables the root
rows by id, but
packages/bundle/web-app/presets/{standard,ptc,cordis}.patch.ymleach declare their own rows with the same ids inside their nested
plugins:lists, which the root-addressed patch never reaches.
Result with Agent Teams enabled:
list_agentsexist in one agent scope (Agent Teams'roster at
tool-agent-team/src/index.ts:233vs.tool-subagent-control/src/list-agents.ts:87);wait_agent(teammates only) is offered next tosubagent, whose backgroundchildren it cannot observe, so it always answers
noProgress: { reason: 'no-active-peer' };when the tool only ever checks team members
(
ui-conversation/src/client/locales.ts:263/:641).Repro
Enable Agent Teams, create a plain subagent with
subagent, then callwait_agent:it returns
noProgress/no-active-peerimmediately regardless oftimeout_ms, whilelist_agentsreturns the teammate roster. Observed in one session: 21 successfulsubagentcalls, 59wait_agentcalls (allno-active-peeroutside the initialteam phase), 24
subagent-settlednotices delivered.Evidence commands are in the Chinese section above (
dsh --profile web --dump-config).Suggested fixes
documented contract —
disabled: !!js "ctx.get('agentTeams') !== undefined"ontool-subagent-control/tool-subagent-list-agents/tool-subagent/tool-subagent-forkin all three presets (12 lines). Patch attached.list_teammates) and update its policy text, docs, client references and tests.detail.wait.noProgressstring to teammates (patch attached).Links / 链接
fix/agent-team-preset-delegation(建议 A,12 行 / 3 文件)https://github.com/zhouyunsheng31/deepseek-harness/tree/fix/agent-team-preset-delegation
fix/wait-agent-no-progress-label(建议 C,3 行 / 2 文件)https://github.com/zhouyunsheng31/deepseek-harness/tree/fix/wait-agent-no-progress-label
两个补丁都基于
master,可直接git apply。提交者未运行仓库测试套件(需 monorepo 全量pnpm install),仅做了 YAML 解析与条件存在性校验。All reactions