Skip to content

fix: add explicit serial workflow instructions to executor handoff and plan-approved message#3912

Merged
esengine merged 2 commits into
esengine:main-v2from
HHHEEEWWW:fix/serial-workflow-instructions
Jun 11, 2026
Merged

fix: add explicit serial workflow instructions to executor handoff and plan-approved message#3912
esengine merged 2 commits into
esengine:main-v2from
HHHEEEWWW:fix/serial-workflow-instructions

Conversation

@HHHEEEWWW

Copy link
Copy Markdown
Contributor

问题

Close #3911

当Agent需要执行多个子任务时,倾向于先全部执行完毕再批量提交complete_step,导致 todo_write 的校验失败。

修改

两个文件的指令增强:

1. internal/agent/coordinator.go - formatHandoff

在 executor handoff 指令中新增一条:

Serial workflow: after finishing EACH sub-task, immediately call complete_step with evidence, then call todo_write to mark it completed and advance the next sub-task. Never batch-complete multiple sub-tasks at once.

2. internal/control/controller.go - planApprovedMessage

将原本的隐式提示增强为显式的 5 步串行循环,并明确约束:Never batch-complete multiple sub-steps at once

验证

  • todo_write 的 verifyTodoCompletionTransitions 本身是正确的防护机制
  • complete_step 的 verifyStepEvidence 要求证据在同一 turn 的 ledger 中
  • 此 PR 仅增强提示词指令,不修改运行时逻辑(低风险)

@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 11, 2026

@esengine esengine left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good targeted fix — the batch-completion failure mode in #3911 is real, and putting the serial contract in both the executor handoff and the plan-approved nudge covers the two entry points. Prompt-only, no cache-prefix material touched. Merging, thanks!

@esengine esengine merged commit 98a365d into esengine:main-v2 Jun 11, 2026
14 checks passed
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.

[Bug] Agent批量提交complete_step导致todo_write校验失败——违反串行工作模式

2 participants