Skip to content

fix(agent): remove executor handoff nudge for guidance-only tasks#4929

Closed
liaoyl830 wants to merge 1 commit into
esengine:main-v2from
liaoyl830:fix-4867-executor-handoff
Closed

fix(agent): remove executor handoff nudge for guidance-only tasks#4929
liaoyl830 wants to merge 1 commit into
esengine:main-v2from
liaoyl830:fix-4867-executor-handoff

Conversation

@liaoyl830

Copy link
Copy Markdown
Contributor

Summary

The executor handoff guard previously nudged the executor to use tools when it gave a text-only final answer. This caused problems for guidance-only tasks where the executor legitimately just relays the planner's instructions without needing to call tools.

The nudge forced the executor to invent tasks to satisfy the tool-use requirement, leading to unnecessary file operations that contradicted the conversation state (e.g., checking import status after user already confirmed success).

Changes

  • Removed the executor handoff nudge logic from internal/agent/agent.go
  • Removed the now-unused executorHandoffGuard field from the Agent struct
  • Removed the executorHandoffRetryMessage function
  • Removed the synthetic prefix entry for the handoff retry message
  • Updated tests to reflect the new behavior

Verification

  • go test ./internal/agent/... ./internal/control/... passes
  • go vet ./... passes
  • gofmt -l shows no changes on modified files

Fixes #4867

Cache impact

Cache-impact: low — Removed a conditional branch in the agent loop's final-answer path. The system prompt prefix is unchanged; only the runtime control flow is affected.
Cache-guard: N/A — No cache-sensitive prefix files were modified.

@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 20, 2026
The executor handoff guard previously nudged the executor to use tools
when it gave a text-only final answer. This caused problems for
guidance-only tasks where the executor legitimately just relays the
planner's instructions without needing to call tools.

The nudge forced the executor to invent tasks to satisfy the tool-use
requirement, leading to unnecessary file operations that contradicted
the conversation state.

Fix: Remove the nudge logic entirely. Executor handoff may be pure
relay — guidance-only tasks don't require tool use. When the executor
gives a visible final answer without tool calls, accept it normally.

Fixes: esengine#4867
@SivanCola

Copy link
Copy Markdown
Collaborator

Thanks @liaoyl830. I reviewed this direction while consolidating the PE handoff fixes into #4938.

This PR removes the executor handoff nudge wholesale. The integration PR chose a narrower path instead: guidance-only handoffs can finish with text, but real work tasks still keep the missing-action nudge so the executor cannot simply restate the plan.

Your investigation and alternative implementation are credited in #4938 under Repository Contributor Credits. Closing this PR in favor of the integration PR.

@SivanCola SivanCola closed this Jun 20, 2026
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] Plan Execute dual-model: executor handoff nudge forces task invention on guidance-only turns

2 participants