fix(agent): remove executor handoff nudge for guidance-only tasks#4929
Closed
liaoyl830 wants to merge 1 commit into
Closed
fix(agent): remove executor handoff nudge for guidance-only tasks#4929liaoyl830 wants to merge 1 commit into
liaoyl830 wants to merge 1 commit into
Conversation
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
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
internal/agent/agent.goexecutorHandoffGuardfield from the Agent structexecutorHandoffRetryMessagefunctionVerification
go test ./internal/agent/... ./internal/control/...passesgo vet ./...passesgofmt -lshows no changes on modified filesFixes #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.