Plan mode persists in ambiguous state when ExitPlanMode is rejected rather than approved
Describe the bug
When a user rejects the \ExitPlanMode\ tool call (rather than approving it) and instead gives a direct instruction like 'Proceed with the plan', plan mode remains technically active in the system but the model receives a conflicting signal — the user's explicit instruction to act.
This creates an ambiguous state with two observable problems:
- The model inconsistently follows plan mode restrictions for the remainder of the session, making edits when given explicit 'apply it' instructions but treating those as equivalent to formal plan approval.
- Eventually the model made an edit without explicit user approval — the exact behaviour plan mode is designed to prevent.
Steps to reproduce
- Trigger plan mode (e.g. via a task that requires planning)
- When the model calls \ExitPlanMode\, reject it and instead say something like 'I have made a backup — proceed with the plan'
- Continue the session giving conversational approvals ('apply it', 'go ahead') for subsequent changes
- Observe the model making edits throughout, despite plan mode never being formally exited
Expected behaviour
Either: plan mode restrictions are enforced strictly regardless of conversational approvals until \ExitPlanMode\ is formally accepted — or: rejecting \ExitPlanMode\ with an explicit 'proceed' instruction should be treated as approval and exit plan mode cleanly.
Actual behaviour
Plan mode persists as an active system state but is inconsistently enforced, ultimately resulting in an edit being made without explicit user approval.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗