Skip to content

fix(coordinator): respect planner 'no changes needed' conclusion#4868

Closed
eghrhegpe wants to merge 2 commits into
esengine:main-v2from
eghrhegpe:pr-coordinator
Closed

fix(coordinator): respect planner 'no changes needed' conclusion#4868
eghrhegpe wants to merge 2 commits into
esengine:main-v2from
eghrhegpe:pr-coordinator

Conversation

@eghrhegpe

@eghrhegpe eghrhegpe commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

问题
两模型模式下(配置了 planner_model),planner 输出「无需修改」后,Coordinator 仍然把计划交给 executor 执行,导致 executor 无视 planner 结论继续改代码。

改动
代码层
在 Coordinator.Run() 加入 isNoOpPlan() 检查——planner 输出包含以下任一短语时跳过 executor:

无需变更:no changes needed / no changes are needed / no changes required / no changes are required
无需操作:no action needed / no action required
无需改动:nothing to change / nothing to do
已完成:already handled / already implemented / already resolved
提示层
formatHandoff 的 executor 指令明确要求:planner 结论可靠,如果它说不用改就别改;只忽略 planner 自身的能力限制(只读、不能写等),不忽略结论。

文件
internal/agent/coordinator.go — +36 / -2

测试
go test ./internal/agent/ -run TestCoordinatorPlannerMaxSteps — 通过。

Cache-impact: none

@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development agent Core agent loop (internal/agent, internal/control) labels Jun 19, 2026
@eghrhegpe

Copy link
Copy Markdown
Contributor Author

运行指标
耗时
2分24秒
请求数
16
会话 tokens
10,139,665
成本
缓存命中

会话费用
¥0.8332

@SivanCola

Copy link
Copy Markdown
Collaborator

Thanks @eghrhegpe. I consolidated the no-op planner conclusion behavior into #4938.

What was kept:

  • when the planner explicitly concludes no changes/action are needed, the Coordinator skips the executor;
  • the phrase set was narrowed slightly so generic positive wording does not accidentally suppress real work.

Your contribution is credited in #4938 under Repository Contributor Credits. Closing this PR in favor of the integration PR.

@SivanCola SivanCola closed this Jun 20, 2026
@eghrhegpe eghrhegpe deleted the pr-coordinator branch June 21, 2026 03:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent Core agent loop (internal/agent, internal/control) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants