Repository navigation
[Bug] exit_plan_mode presents a plan while the background subagents it depends on are still running — plan finalization must wait for all delegations #9876
Replies: 2 comments
|
Your reading holds up at source, and it is worth stating more strongly than the report does: this is not a race with a missing check — there is no check to race.
The shipped guidance is where the gap actually lives, and the model is obeying it. The What the waiting surface really is, enumerated. The There is a blocking wait in the tree, but it cannot reach a delegation: Two details that sharpen the fix. First, a gate built on The signal you say is missing has a seam, and it is plugin-mountable. Two honest limits of that shape, since they decide whether it is worth building: a plugin can refuse and explain, but it cannot make the model wait or coalesce the notices — the release has to come from state (the children settling), never from a timer, or the guard turns a stale plan into a stuck one. And the state it reads ( If it is useful, I can build that as a small plugin ( |
|
谢谢这份源码级复核,结论我们接受。你指出的两处锐化我们也同意,并已确认其准确性:
先补三条事实,都是我们在刚发布的 0.2.1-rc.2(tag
也就是说:结算通知在协议层确实是设计中的 join 原语,但当前发布版没有任何提示让模型停止轮询、结束本轮。 为什么我们坚持"硬门禁"而不是"提示"或"在评审界面展示":这份计划不是独立文档,它是全部已委派调查结果的聚合产物。只要有委派未落定,计划在定义上就不完整,而 plan mode 的价值恰恰在于"被评审的是一份已被调查结果支撑过的计划"。本次 trace 里 关于插件:我们接受,也很期待
最后,想再强调一下我们理解的问题重点,供你和维护者参考(也正是我们报告里那条
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Summary
Plan 模式下,父 Agent 可以在它依赖的后台委派(
subagent,默认run_in_background: true)仍在运行时,就调用exit_plan_mode提交计划,于是进入评审的计划是基于不完整输入产出的。这个计划可能直接被批准;委派落定之后又必须重新提交一版(v2)。问题不只是"缺少提示":计划本身是全部已委派调查结果的汇总产物,只要还有委派未落定,这份计划在定义上就是不完整的,不应该进入评审。plan-mode policy 文本、
exit_plan_mode的契约与返回值、计划评审界面,都不包含任何"仍有在途委派"的信号;随包发布的dsh-baseprofile 也没有面向模型的 join/wait 原语,模型没有可靠手段等到"全部回复"。Reproduction
subagent起两个只读调研子 Agent(默认后台运行),两者都是计划必须覆盖的调查。list_agents持续返回[running]:本次 trace 中父 Agent 轮询了 8 次(step 63 / 73 / 103 / 111 / 127 / 130 / 133 / 138),step 138 的结果是两行… [running] — <label>。exit_plan_mode提交计划;其 reasoning 明说会在实施阶段再把"这些子 Agent 的发现并进来"。此时两个子 Agent 都还在运行,两份调查报告都还没产出。Current behavior
exit_plan_mode只校验四件事:调用者 agent 存在、plan mode 处于 active、计划以#标题开头、存在用户提问通道。它不读取调用者的子 Agent/后台任务状态,因此在依赖的委派未落定时也会照常进入评审。packages/bundle/base/cordis.patch.yml的section)说明了如何探索、计划要写到什么程度,但完全没有提到在途委派,也没有"计划必须覆盖全部已委派调查"这条要求。Start independent subagent delegations together in one assistant message and continue useful work while they run.,没有"只剩等待时该怎么办";而list_agents的说明是 "there is no need to keep checking its status"。两者叠加后,模型手上只剩"轮询"和"按现有信息先交计划"两条路——本次它两条都走了(轮询 8 次后仍然提前提交)。(master 的7a881e944已补上When only waiting for their results remains, end your turn instead of sleeping or polling; the next result starts a new turn.,这条通用规则本身很好,但它仍没有把"计划定稿"与"委派是否全部落定"绑在一起。)waitForChildren(parent)是 service API(文档明确写 "Programmatic result waiting belongs to the subagent service"),wait_agent只存在于实验性 agent-team 包,而dsh-base默认禁用该包。所以"等全部 subagent 回复"目前只能靠模型自觉结束本轮。相关观察(master 已由
18a4bc409处理):在 0.2.0-rc.2 中,dismissed 评审是以 tool error 返回的——The user dismissed the plan review to speak instead; stay in plan mode, stop here, and wait for their message.——但这个 turn 并没有结束:4 条已排队的 inbox 条目(2 份子 Agent 报告 + 2 条 settlement 通知)在同一条 turn 里直接开启了下一个 step,于是计划在用户没有发任何消息的情况下被重新提交并获得批准。用户"收回这一轮"的意图被子 Agent 的落定消息覆盖了。Expected behavior
计划是全部调查结果的汇总产物,因此"全部委派落定"必须是
exit_plan_mode的硬前置条件,而不是提示项:exit_plan_mode读取调用者的 live descendants;只要仍有处于 running 的委派,调用即失败,例如2 delegations are still running: <id> — <label>, <id> — <label>; wait for all of them to settle before presenting the plan。计划不进入评审界面,用户也就没有任何机会批准一份建立在部分输入上的计划。exit_plan_mode",并明确"结束本轮"是 plan mode 下受支持的等待方式(落定消息开启新一轮,届时再提交完整计划)。否则模型只能在轮询与提前交计划之间二选一。list_agents返回[running]之后仍然提交了计划,说明"提示"挡不住 stale plan 进入评审;把决定权交回用户也只是把"要不要用不完整输入定稿"这个系统性问题变成了人工兜底。Environment
@deepseek-ai/dsh-plan-mode0.2.0-rc.2、@deepseek-ai/dsh-tool-subagent0.2.0-rc.2。plan/mode、tool/call、agent/inbox/spliced事件)。All reactions