Problem
When exiting plan mode via the exit_plan_mode tool, users are presented with 3 options:
- Yes, and auto-accept edits →
AUTO_EDIT
- Yes, and manually approve edits →
DEFAULT
- No, keep planning (esc) →
PLAN
If the user entered plan mode from YOLO mode, none of the current options restore YOLO. Selecting "Yes, and auto-accept edits" switches to AUTO_EDIT (which still requires manual approval for shell commands), and "Yes, and manually approve edits" switches to DEFAULT. The user is forced to manually switch back to YOLO via Shift+Tab or /approval-mode yolo after every plan approval.
Proposal
Add a 4th option "Yes, restore previous mode" (as the default selection) that restores the approval mode that was active before entering plan mode, using the existing config.getPrePlanMode() mechanism.
The updated option list would be:
| # |
Label |
Behavior |
| 1 |
Yes, restore previous mode (default) |
config.getPrePlanMode() |
| 2 |
Yes, and auto-accept edits |
ApprovalMode.AUTO_EDIT |
| 3 |
Yes, and manually approve edits |
ApprovalMode.DEFAULT |
| 4 |
No, keep planning (esc) |
ApprovalMode.PLAN |
Why this matters
- YOLO users expect to return to YOLO after approving a plan — the current flow silently downgrades their permission level
- AUTO_EDIT users similarly expect to return to AUTO_EDIT, not DEFAULT
- The
prePlanMode tracking infrastructure already exists in config.ts (getPrePlanMode() / setApprovalMode()), so the backend is ready — only the UI option and a new ToolConfirmationOutcome (or reuse of an existing one) need to be wired up
Implementation hints
- Add option in
ToolConfirmationMessage.tsx with a new outcome mapped to getPrePlanMode()
- Handle the new outcome in
exitPlanMode.ts onConfirm() callback
- Consider dynamically labeling it (e.g., "Yes, restore previous mode (yolo)") so the user knows which mode they're returning to
Problem
When exiting plan mode via the
exit_plan_modetool, users are presented with 3 options:AUTO_EDITDEFAULTPLANIf the user entered plan mode from YOLO mode, none of the current options restore YOLO. Selecting "Yes, and auto-accept edits" switches to
AUTO_EDIT(which still requires manual approval for shell commands), and "Yes, and manually approve edits" switches toDEFAULT. The user is forced to manually switch back to YOLO viaShift+Tabor/approval-mode yoloafter every plan approval.Proposal
Add a 4th option "Yes, restore previous mode" (as the default selection) that restores the approval mode that was active before entering plan mode, using the existing
config.getPrePlanMode()mechanism.The updated option list would be:
config.getPrePlanMode()ApprovalMode.AUTO_EDITApprovalMode.DEFAULTApprovalMode.PLANWhy this matters
prePlanModetracking infrastructure already exists inconfig.ts(getPrePlanMode()/setApprovalMode()), so the backend is ready — only the UI option and a newToolConfirmationOutcome(or reuse of an existing one) need to be wired upImplementation hints
ToolConfirmationMessage.tsxwith a new outcome mapped togetPrePlanMode()exitPlanMode.tsonConfirm()callback