Skip to content

Commit 121af70

Browse files
committed
fix: ProceedOnce should set DEFAULT mode, not restore pre-plan mode
"Yes, and manually approve edits" was restoring getPrePlanMode() which could be YOLO, contradicting the label. Now hardcodes DEFAULT to match the "manually approve" semantics.
1 parent 1d4c17b commit 121af70

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

packages/core/src/tools/exitPlanMode.test.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,9 @@ describe('ExitPlanModeTool', () => {
178178
expect(approvalMode).toBe(ApprovalMode.AUTO_EDIT);
179179
});
180180

181-
it('should restore pre-plan mode on ProceedOnce', async () => {
182-
// Simulate entering plan mode from AUTO_EDIT
181+
it('should set DEFAULT mode on ProceedOnce regardless of pre-plan mode', async () => {
182+
// Even if pre-plan mode was AUTO_EDIT, ProceedOnce ("manually approve
183+
// edits") should always set DEFAULT to match the option label semantics.
183184
(mockConfig.getPrePlanMode as ReturnType<typeof vi.fn>).mockReturnValue(
184185
ApprovalMode.AUTO_EDIT,
185186
);
@@ -195,9 +196,9 @@ describe('ExitPlanModeTool', () => {
195196
}
196197

197198
expect(mockConfig.setApprovalMode).toHaveBeenCalledWith(
198-
ApprovalMode.AUTO_EDIT,
199+
ApprovalMode.DEFAULT,
199200
);
200-
expect(approvalMode).toBe(ApprovalMode.AUTO_EDIT);
201+
expect(approvalMode).toBe(ApprovalMode.DEFAULT);
201202
});
202203

203204
it('should remain in plan mode when confirmation is rejected', async () => {

packages/core/src/tools/exitPlanMode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class ExitPlanModeToolInvocation extends BaseToolInvocation<
9999
break;
100100
case ToolConfirmationOutcome.ProceedOnce:
101101
this.wasApproved = true;
102-
this.setApprovalModeSafely(this.config.getPrePlanMode());
102+
this.setApprovalModeSafely(ApprovalMode.DEFAULT);
103103
break;
104104
case ToolConfirmationOutcome.Cancel:
105105
this.wasApproved = false;

0 commit comments

Comments
 (0)