Skip to content

Commit c5d5603

Browse files
fix(patch): cherry-pick 467a305 to release/v0.9.0-preview.0-pr-10661 to patch version v0.9.0-preview.0 and create version 0.9.0-preview.1 (#10817)
Co-authored-by: Gal Zahavi <38544478+galz10@users.noreply.github.com>
1 parent cf1c8b2 commit c5d5603

18 files changed

Lines changed: 114 additions & 113 deletions

docs/get-started/configuration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,8 @@ Settings are organized into categories. All settings should be placed within the
206206
- **Default:** `undefined`
207207

208208
- **`tools.shell.enableInteractiveShell`** (boolean):
209-
210-
Use `node-pty` for an interactive shell experience. Fallback to `child_process` still applies. Defaults to `false`.
209+
- **Description:** Enables interactive terminal for running shell commands. If an interactive session cannot be started, it will fall back to a standard shell.
210+
- **Default:** `true`
211211

212212
- **`tools.core`** (array of strings):
213213
- **Description:** This can be used to restrict the set of built-in tools [with an allowlist](../cli/enterprise.md#restricting-tool-access). See [Built-in Tools](../core/tools-api.md#built-in-tools) for a list of core tools. The match semantics are the same as `tools.allowed`.

integration-tests/context-compress-interactive.test.ts

Lines changed: 83 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -18,93 +18,87 @@ describe('Interactive Mode', () => {
1818
await rig.cleanup();
1919
});
2020

21-
it.skipIf(process.platform === 'win32')(
22-
'should trigger chat compression with /compress command',
23-
async () => {
24-
await rig.setup('interactive-compress-test');
25-
26-
const { ptyProcess } = rig.runInteractive();
27-
28-
let fullOutput = '';
29-
ptyProcess.onData((data) => (fullOutput += data));
30-
31-
const authDialogAppeared = await rig.waitForText(
32-
'How would you like to authenticate',
33-
5000,
34-
);
35-
36-
// select the second option if auth dialog come's up
37-
if (authDialogAppeared) {
38-
ptyProcess.write('2');
39-
}
40-
41-
// Wait for the app to be ready
42-
const isReady = await rig.waitForText('Type your message', 15000);
43-
expect(
44-
isReady,
45-
'CLI did not start up in interactive mode correctly',
46-
).toBe(true);
47-
48-
const longPrompt =
49-
'Dont do anything except returning a 1000 token long paragragh with the <name of the scientist who discovered theory of relativity> at the end to indicate end of response. This is a moderately long sentence.';
50-
51-
await type(ptyProcess, longPrompt);
52-
await type(ptyProcess, '\r');
53-
54-
await rig.waitForText('einstein', 25000);
55-
56-
await type(ptyProcess, '/compress');
57-
// A small delay to allow React to re-render the command list.
58-
await new Promise((resolve) => setTimeout(resolve, 100));
59-
await type(ptyProcess, '\r');
60-
61-
const foundEvent = await rig.waitForTelemetryEvent(
62-
'chat_compression',
63-
90000,
64-
);
65-
expect(foundEvent, 'chat_compression telemetry event was not found').toBe(
66-
true,
67-
);
68-
},
69-
);
70-
71-
it.skipIf(process.platform === 'win32')(
72-
'should handle compression failure on token inflation',
73-
async () => {
74-
await rig.setup('interactive-compress-test');
75-
76-
const { ptyProcess } = rig.runInteractive();
77-
78-
let fullOutput = '';
79-
ptyProcess.onData((data) => (fullOutput += data));
80-
81-
const authDialogAppeared = await rig.waitForText(
82-
'How would you like to authenticate',
83-
5000,
84-
);
85-
86-
// select the second option if auth dialog come's up
87-
if (authDialogAppeared) {
88-
ptyProcess.write('2');
89-
}
90-
91-
// Wait for the app to be ready
92-
const isReady = await rig.waitForText('Type your message', 25000);
93-
expect(
94-
isReady,
95-
'CLI did not start up in interactive mode correctly',
96-
).toBe(true);
97-
98-
await type(ptyProcess, '/compress');
99-
await new Promise((resolve) => setTimeout(resolve, 100));
100-
await type(ptyProcess, '\r');
101-
102-
const compressionFailed = await rig.waitForText(
103-
'compression was not beneficial',
104-
25000,
105-
);
106-
107-
expect(compressionFailed).toBe(true);
108-
},
109-
);
21+
//TODO - https://github.com/google-gemini/gemini-cli/issues/10770
22+
it.skip('should trigger chat compression with /compress command', async () => {
23+
await rig.setup('interactive-compress-test');
24+
25+
const { ptyProcess } = rig.runInteractive();
26+
27+
let fullOutput = '';
28+
ptyProcess.onData((data) => (fullOutput += data));
29+
30+
const authDialogAppeared = await rig.waitForText(
31+
'How would you like to authenticate',
32+
5000,
33+
);
34+
35+
// select the second option if auth dialog come's up
36+
if (authDialogAppeared) {
37+
ptyProcess.write('2');
38+
}
39+
40+
// Wait for the app to be ready
41+
const isReady = await rig.waitForText('Type your message', 15000);
42+
expect(isReady, 'CLI did not start up in interactive mode correctly').toBe(
43+
true,
44+
);
45+
46+
const longPrompt =
47+
'Dont do anything except returning a 1000 token long paragragh with the <name of the scientist who discovered theory of relativity> at the end to indicate end of response. This is a moderately long sentence.';
48+
49+
await type(ptyProcess, longPrompt);
50+
await type(ptyProcess, '\r');
51+
52+
await rig.waitForText('einstein', 25000);
53+
54+
await type(ptyProcess, '/compress');
55+
// A small delay to allow React to re-render the command list.
56+
await new Promise((resolve) => setTimeout(resolve, 100));
57+
await type(ptyProcess, '\r');
58+
59+
const foundEvent = await rig.waitForTelemetryEvent(
60+
'chat_compression',
61+
90000,
62+
);
63+
expect(foundEvent, 'chat_compression telemetry event was not found').toBe(
64+
true,
65+
);
66+
});
67+
68+
//TODO - https://github.com/google-gemini/gemini-cli/issues/10769
69+
it.skip('should handle compression failure on token inflation', async () => {
70+
await rig.setup('interactive-compress-test');
71+
72+
const { ptyProcess } = rig.runInteractive();
73+
74+
let fullOutput = '';
75+
ptyProcess.onData((data) => (fullOutput += data));
76+
77+
const authDialogAppeared = await rig.waitForText(
78+
'How would you like to authenticate',
79+
5000,
80+
);
81+
82+
// select the second option if auth dialog come's up
83+
if (authDialogAppeared) {
84+
ptyProcess.write('2');
85+
}
86+
87+
// Wait for the app to be ready
88+
const isReady = await rig.waitForText('Type your message', 25000);
89+
expect(isReady, 'CLI did not start up in interactive mode correctly').toBe(
90+
true,
91+
);
92+
93+
await type(ptyProcess, '/compress');
94+
await new Promise((resolve) => setTimeout(resolve, 100));
95+
await type(ptyProcess, '\r');
96+
97+
const compressionFailed = await rig.waitForText(
98+
'compression was not beneficial',
99+
25000,
100+
);
101+
102+
expect(compressionFailed).toBe(true);
103+
});
110104
});

integration-tests/mcp_server_cyclic_schema.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@ describe('mcp server with cyclic tool schema is detected', () => {
192192
}
193193
});
194194

195-
it('mcp tool list should include tool with cyclic tool schema', async () => {
195+
//TODO - https://github.com/google-gemini/gemini-cli/issues/10735
196+
it.skip('mcp tool list should include tool with cyclic tool schema', async () => {
196197
const tool_list_output = await rig.run('/mcp list');
197198
expect(tool_list_output).toContain('tool_with_cyclic_schema');
198199
});

integration-tests/run_shell_command.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,8 @@ describe('run_shell_command', () => {
197197
).toBeTruthy();
198198
});
199199

200-
it('should combine multiple --allowed-tools flags', async () => {
200+
//TODO - https://github.com/google-gemini/gemini-cli/issues/10737
201+
it.skip('should combine multiple --allowed-tools flags', async () => {
201202
const rig = new TestRig();
202203
await rig.setup('should combine multiple --allowed-tools flags');
203204

@@ -226,7 +227,8 @@ describe('run_shell_command', () => {
226227
).toBeTruthy();
227228
});
228229

229-
it('should allow all with "ShellTool" and other specifics', async () => {
230+
//TODO - https://github.com/google-gemini/gemini-cli/issues/10768
231+
it.skip('should allow all with "ShellTool" and other specifics', async () => {
230232
const rig = new TestRig();
231233
await rig.setup('should allow all with "ShellTool" and other specifics');
232234

integration-tests/simple-mcp-server.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,8 @@ describe('simple-mcp-server', () => {
210210
}
211211
});
212212

213-
it('should add two numbers', async () => {
213+
//TODO -https://github.com/google-gemini/gemini-cli/issues/10738
214+
it.skip('should add two numbers', async () => {
214215
// Test directory is already set up in before hook
215216
// Just run the command - MCP server config is in settings.json
216217
const output = await rig.run('add 5 and 10');

packages/cli/src/config/config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,8 @@ export async function loadCliConfig(
737737
interactive,
738738
trustedFolder,
739739
useRipgrep: settings.tools?.useRipgrep,
740-
shouldUseNodePtyShell: settings.tools?.shell?.enableInteractiveShell,
740+
enableInteractiveShell:
741+
settings.tools?.shell?.enableInteractiveShell ?? true,
741742
skipNextSpeakerCheck: settings.model?.skipNextSpeakerCheck,
742743
enablePromptCompletion: settings.general?.enablePromptCompletion ?? false,
743744
truncateToolOutputThreshold: settings.tools?.truncateToolOutputThreshold,

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,8 @@ describe('extension tests', () => {
869869
expect(mockLogExtensionInstallEvent).toHaveBeenCalled();
870870
});
871871

872-
it('should show users information on their mcp server when installing', async () => {
872+
//TODO - https://github.com/google-gemini/gemini-cli/issues/10739
873+
it.skip('should show users information on their mcp server when installing', async () => {
873874
const consoleInfoSpy = vi.spyOn(console, 'info');
874875
const sourceExtDir = createExtension({
875876
extensionsDir: tempHomeDir,

packages/cli/src/config/settings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ const MIGRATION_MAP: Record<string, string> = {
110110
preferredEditor: 'general.preferredEditor',
111111
sandbox: 'tools.sandbox',
112112
selectedAuthType: 'security.auth.selectedType',
113-
shouldUseNodePtyShell: 'tools.shell.enableInteractiveShell',
113+
enableInteractiveShell: 'tools.shell.enableInteractiveShell',
114114
shellPager: 'tools.shell.pager',
115115
shellShowColor: 'tools.shell.showColor',
116116
skipNextSpeakerCheck: 'model.skipNextSpeakerCheck',

packages/cli/src/config/settingsSchema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ const SETTINGS_SCHEMA = {
713713
label: 'Enable Interactive Shell',
714714
category: 'Tools',
715715
requiresRestart: true,
716-
default: false,
716+
default: true,
717717
description:
718718
'Use node-pty for an interactive shell experience. Fallback to child_process still applies.',
719719
showInDialog: true,

packages/cli/src/services/prompt-processors/shellProcessor.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ describe('ShellProcessor', () => {
7070
mockConfig = {
7171
getTargetDir: vi.fn().mockReturnValue('/test/dir'),
7272
getApprovalMode: vi.fn().mockReturnValue(ApprovalMode.DEFAULT),
73-
getShouldUseNodePtyShell: vi.fn().mockReturnValue(false),
73+
getEnableInteractiveShell: vi.fn().mockReturnValue(false),
7474
getShellExecutionConfig: vi.fn().mockReturnValue({}),
7575
};
7676

0 commit comments

Comments
 (0)