Skip to content

Commit 8aade30

Browse files
authored
feat(plan): enable Plan Mode by default (#21713)
1 parent df07cf4 commit 8aade30

15 files changed

Lines changed: 32 additions & 48 deletions

docs/cli/plan-mode.md

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Plan Mode (experimental)
1+
# Plan Mode
22

33
Plan Mode is a read-only environment for architecting robust solutions before
44
implementation. With Plan Mode, you can:
@@ -8,27 +8,8 @@ implementation. With Plan Mode, you can:
88
- **Design:** Understand problems, evaluate trade-offs, and choose a solution.
99
- **Plan:** Align on an execution strategy before any code is modified.
1010

11-
> **Note:** This is a preview feature currently under active development. Your
12-
> feedback is invaluable as we refine this feature. If you have ideas,
13-
> suggestions, or encounter issues:
14-
>
15-
> - [Open an issue] on GitHub.
16-
> - Use the **/bug** command within Gemini CLI to file an issue.
17-
18-
## How to enable Plan Mode
19-
20-
Enable Plan Mode in **Settings** or by editing your configuration file.
21-
22-
- **Settings:** Use the `/settings` command and set **Plan** to `true`.
23-
- **Configuration:** Add the following to your `settings.json`:
24-
25-
```json
26-
{
27-
"experimental": {
28-
"plan": true
29-
}
30-
}
31-
```
11+
Plan Mode is enabled by default. You can manage this setting using the
12+
`/settings` command.
3213

3314
## How to enter Plan Mode
3415

docs/cli/settings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ they appear in the UI.
144144
| Enable Tool Output Masking | `experimental.toolOutputMasking.enabled` | Enables tool output masking to save tokens. | `true` |
145145
| Use OSC 52 Paste | `experimental.useOSC52Paste` | Use OSC 52 for pasting. This may be more robust than the default system when using remote terminal sessions (if your terminal is configured to allow it). | `false` |
146146
| Use OSC 52 Copy | `experimental.useOSC52Copy` | Use OSC 52 for copying. This may be more robust than the default system when using remote terminal sessions (if your terminal is configured to allow it). | `false` |
147-
| Plan | `experimental.plan` | Enable planning features (Plan Mode and tools). | `false` |
147+
| Plan | `experimental.plan` | Enable Plan Mode. | `true` |
148148
| Model Steering | `experimental.modelSteering` | Enable model steering (user hints) to guide the model during tool execution. | `false` |
149149
| Direct Web Fetch | `experimental.directWebFetch` | Enable web fetch behavior that bypasses LLM summarization. | `false` |
150150

docs/reference/commands.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,8 @@ Slash commands provide meta-level control over the CLI itself.
279279

280280
- **Description:** Switch to Plan Mode (read-only) and view the current plan if
281281
one has been generated.
282-
- **Note:** This feature requires the `experimental.plan` setting to be
283-
enabled in your configuration.
282+
- **Note:** This feature is enabled by default. It can be disabled via the
283+
`experimental.plan` setting in your configuration.
284284
- **Sub-commands:**
285285
- **`copy`**:
286286
- **Description:** Copy the currently approved plan to your clipboard.

docs/reference/configuration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,8 +1021,8 @@ their corresponding top-level category object in your `settings.json` file.
10211021
- **Default:** `false`
10221022

10231023
- **`experimental.plan`** (boolean):
1024-
- **Description:** Enable planning features (Plan Mode and tools).
1025-
- **Default:** `false`
1024+
- **Description:** Enable Plan Mode.
1025+
- **Default:** `true`
10261026
- **Requires restart:** Yes
10271027

10281028
- **`experimental.taskTracker`** (boolean):

packages/cli/src/acp/acpClient.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ describe('GeminiAgent', () => {
172172
unsubscribe: vi.fn(),
173173
}),
174174
getApprovalMode: vi.fn().mockReturnValue('default'),
175-
isPlanEnabled: vi.fn().mockReturnValue(false),
175+
isPlanEnabled: vi.fn().mockReturnValue(true),
176176
getGemini31LaunchedSync: vi.fn().mockReturnValue(false),
177177
getHasAccessToPreviewModel: vi.fn().mockReturnValue(false),
178178
getCheckpointingEnabled: vi.fn().mockReturnValue(false),
@@ -650,7 +650,7 @@ describe('Session', () => {
650650
getMessageBus: vi.fn().mockReturnValue(mockMessageBus),
651651
setApprovalMode: vi.fn(),
652652
setModel: vi.fn(),
653-
isPlanEnabled: vi.fn().mockReturnValue(false),
653+
isPlanEnabled: vi.fn().mockReturnValue(true),
654654
getCheckpointingEnabled: vi.fn().mockReturnValue(false),
655655
getGitService: vi.fn().mockResolvedValue({} as GitService),
656656
waitForMcpInit: vi.fn(),

packages/cli/src/acp/acpResume.test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ describe('GeminiAgent Session Resume', () => {
9292
getProjectTempDir: vi.fn().mockReturnValue('/tmp/project'),
9393
},
9494
getApprovalMode: vi.fn().mockReturnValue('default'),
95-
isPlanEnabled: vi.fn().mockReturnValue(false),
95+
isPlanEnabled: vi.fn().mockReturnValue(true),
9696
getModel: vi.fn().mockReturnValue('gemini-pro'),
9797
getHasAccessToPreviewModel: vi.fn().mockReturnValue(false),
9898
getGemini31LaunchedSync: vi.fn().mockReturnValue(false),
@@ -204,6 +204,11 @@ describe('GeminiAgent Session Resume', () => {
204204
name: 'YOLO',
205205
description: 'Auto-approves all tools',
206206
},
207+
{
208+
id: ApprovalMode.PLAN,
209+
name: 'Plan',
210+
description: 'Read-only mode',
211+
},
207212
],
208213
currentModeId: ApprovalMode.DEFAULT,
209214
},

packages/cli/src/config/config.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2622,13 +2622,13 @@ describe('loadCliConfig approval mode', () => {
26222622
expect(config.getApprovalMode()).toBe(ApprovalMode.DEFAULT);
26232623
});
26242624

2625-
it('should throw error when --approval-mode=plan is used but experimental.plan setting is missing', async () => {
2625+
it('should allow plan approval mode by default when --approval-mode=plan is used', async () => {
26262626
process.argv = ['node', 'script.js', '--approval-mode', 'plan'];
26272627
const argv = await parseArguments(createTestMergedSettings());
26282628
const settings = createTestMergedSettings({});
26292629

26302630
const config = await loadCliConfig(settings, 'test-session', argv);
2631-
expect(config.getApprovalMode()).toBe(ApprovalMode.DEFAULT);
2631+
expect(config.getApprovalMode()).toBe(ApprovalMode.PLAN);
26322632
});
26332633

26342634
it('should pass planSettings.directory from settings to config', async () => {

packages/cli/src/config/settingsSchema.test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -424,12 +424,10 @@ describe('SettingsSchema', () => {
424424
expect(setting).toBeDefined();
425425
expect(setting.type).toBe('boolean');
426426
expect(setting.category).toBe('Experimental');
427-
expect(setting.default).toBe(false);
427+
expect(setting.default).toBe(true);
428428
expect(setting.requiresRestart).toBe(true);
429429
expect(setting.showInDialog).toBe(true);
430-
expect(setting.description).toBe(
431-
'Enable planning features (Plan Mode and tools).',
432-
);
430+
expect(setting.description).toBe('Enable Plan Mode.');
433431
});
434432

435433
it('should have hooksConfig.notifications setting in schema', () => {

packages/cli/src/config/settingsSchema.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1823,8 +1823,8 @@ const SETTINGS_SCHEMA = {
18231823
label: 'Plan',
18241824
category: 'Experimental',
18251825
requiresRestart: true,
1826-
default: false,
1827-
description: 'Enable planning features (Plan Mode and tools).',
1826+
default: true,
1827+
description: 'Enable Plan Mode.',
18281828
showInDialog: true,
18291829
},
18301830
taskTracker: {

packages/cli/src/services/BuiltinCommandLoader.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ describe('BuiltinCommandLoader', () => {
151151
vi.clearAllMocks();
152152
mockConfig = {
153153
getFolderTrust: vi.fn().mockReturnValue(true),
154-
isPlanEnabled: vi.fn().mockReturnValue(false),
154+
isPlanEnabled: vi.fn().mockReturnValue(true),
155155
getEnableExtensionReloading: () => false,
156156
getEnableHooks: () => false,
157157
getEnableHooksUI: () => false,
@@ -351,7 +351,7 @@ describe('BuiltinCommandLoader profile', () => {
351351
vi.resetModules();
352352
mockConfig = {
353353
getFolderTrust: vi.fn().mockReturnValue(false),
354-
isPlanEnabled: vi.fn().mockReturnValue(false),
354+
isPlanEnabled: vi.fn().mockReturnValue(true),
355355
getCheckpointingEnabled: () => false,
356356
getEnableExtensionReloading: () => false,
357357
getEnableHooks: () => false,

0 commit comments

Comments
 (0)