refactor(control): drop phrase-matched approved-plan continuation#4266
Merged
Conversation
#4250 carried an approved plan's writer auto-approval across a user pause when the next turn matched a fixed phrase whitelist (继续 / continue / …). That is the brittle intent-detection the project removed elsewhere, and a false positive silently widens auto-approval. Auto-approval now covers the execution turn only; any later turn — including "continue" — returns to the normal per-tool approval posture (ask/auto/yolo still govern it). The plan still seeds todos and avoids clobbering the model's own todo_write. Removes approvedPlanActive/approvedPlanContinuationTurn, the execution marker, and isApprovedPlanContinuation.
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.
Follow-up to #4250 / the review of session-ownership work.
#4250 added a mechanism to carry an approved plan's writer auto-approval across a user pause: on the next turn, if the text matched a fixed phrase whitelist (
继续/continue/proceed/ …) it re-armed auto-approval and injected a continuation marker; otherwise it dropped back to per-tool approval.That phrase whitelist is exactly the brittle intent-detection this project deliberately removed elsewhere — and the failure mode isn't symmetric: a false positive (any user turn that happens to be a bare "continue") silently widens writer auto-approval for that turn.
Change: plan-approval auto-approval now covers the execution turn only (unchanged
approvedPlanAutoApproveTools, reset on turn return). Any later turn — including "continue" — returns to the normal per-tool approval posture;ask/auto/yolostill govern it, and that's the explicit, non-fragile mechanism for unattended execution. The plan still seeds todos and still avoids clobbering the model's owntodo_write(the kepthasTodoUpdateSinceguard).Removes
approvedPlanActive/approvedPlanContinuationTurn/approvedPlanStart, the execution marker const,isApprovedPlanContinuation, and the now-dead reset sites — net −204 lines in non-test code.Tests: rewrote the survive-pause test to lock in that "继续" no longer carries approval (writer prompts after the execution turn); kept the non-continuation test; dropped the prose-plan continuation test.
go build/vet,staticcheck, andgo test ./internal/controlclean.