fix(agent): prevent executor handoff role confusion / 防止执行器交接角色混淆#3541
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Bare permission claims (no write access / 没有写入权限) are the exact vocabulary a correctly-executing model uses to report a real blocker; matching them mis-fired the planner-confusion guard and could hard-error a legitimately-blocked task. Drop those phrases, keep role-identity ones, and lock it with a regression test.
esengine
approved these changes
Jun 8, 2026
esengine
left a comment
Owner
There was a problem hiding this comment.
Solid fix for the planner→executor confusion (#3490), with a regression test. I tightened the confusion matcher to role-identity phrases only — bare permission claims like "no write access" / "没有写入权限" were also matching legitimate blocker reports (the exact vocabulary the handoff prompt asks the executor to use), which could hard-error a genuinely-blocked task. Added a regression test for that. Full go test ./internal/agent is green.
The keyword list matched on vocabulary, so it both missed paraphrases
and false-flagged legitimate blocker reports ("no write access" is the
exact phrasing the handoff prompt asks the executor to use). Replace it
with a structural signal: if the executor reaches a final answer in
handoff mode having called zero tools, nudge once with the executor
instructions, then trust it — no keyword table, no hard error. Any tool
use (including read-only) exempts it, so only a true punt triggers the
nudge. Language-independent.
Tests cover both the nudge and the no-nudge-when-acting path; verified
end-to-end with a live deepseek-pro planner / deepseek-flash executor
run that wrote and ran the file without tripping the guard.
dorokuma
pushed a commit
to dorokuma/DeepSeek-Reasonix
that referenced
this pull request
Jun 10, 2026
…engine#3541) * fix(agent): keep executor from answering as planner * fix(agent): scope handoff-confusion match to role-identity phrases Bare permission claims (no write access / 没有写入权限) are the exact vocabulary a correctly-executing model uses to report a real blocker; matching them mis-fired the planner-confusion guard and could hard-error a legitimately-blocked task. Drop those phrases, keep role-identity ones, and lock it with a regression test. * fix(agent): detect executor punt by behavior, not keywords The keyword list matched on vocabulary, so it both missed paraphrases and false-flagged legitimate blocker reports ("no write access" is the exact phrasing the handoff prompt asks the executor to use). Replace it with a structural signal: if the executor reaches a final answer in handoff mode having called zero tools, nudge once with the executor instructions, then trust it — no keyword table, no hard error. Any tool use (including read-only) exempts it, so only a true punt triggers the nudge. Language-independent. Tests cover both the nudge and the no-nudge-when-acting path; verified end-to-end with a live deepseek-pro planner / deepseek-flash executor run that wrote and ran the file without tripping the guard. --------- Co-authored-by: reasonix <reasonix@deepseek.com>
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.
Refs #3490
Summary
Testing
go test ./internal/agent ./internal/boot ./internal/config ./internal/clicd desktop && go test . -run 'TestSettings|TestSetAgent|Test.*Settings|TestProviderViewFromEntry'npm run check:css && npm run test:typecheck