Skip to content

refactor(control): drop phrase-matched approved-plan continuation#4266

Merged
esengine merged 1 commit into
main-v2from
refactor/drop-plan-continuation-whitelist
Jun 13, 2026
Merged

refactor(control): drop phrase-matched approved-plan continuation#4266
esengine merged 1 commit into
main-v2from
refactor/drop-plan-continuation-whitelist

Conversation

@esengine

Copy link
Copy Markdown
Owner

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/yolo still 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 own todo_write (the kept hasTodoUpdateSince guard).

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, and go test ./internal/control clean.

#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.
@esengine esengine requested a review from SivanCola as a code owner June 13, 2026 07:04
@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 13, 2026
@esengine esengine merged commit 2008f09 into main-v2 Jun 13, 2026
14 checks passed
@esengine esengine deleted the refactor/drop-plan-continuation-whitelist branch June 13, 2026 07:09
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.

1 participant