summaryrefslogtreecommitdiff
path: root/packages/core/src/tools/shell.test.ts
diff options
context:
space:
mode:
authorDaniel Lee <[email protected]>2025-07-24 10:13:00 -0700
committerGitHub <[email protected]>2025-07-24 17:13:00 +0000
commit3dd6e431df057af47b96990d0c9c6477ccfbe452 (patch)
tree8a75c928b0c558d82a5470a504ff57f48002f801 /packages/core/src/tools/shell.test.ts
parent52980510c92deb4af4c9012ae23bd67f169c1a32 (diff)
feat: add GEMINI_CLI environment variable to spawned shell commands (#4791)
Diffstat (limited to 'packages/core/src/tools/shell.test.ts')
-rw-r--r--packages/core/src/tools/shell.test.ts20
1 files changed, 20 insertions, 0 deletions
diff --git a/packages/core/src/tools/shell.test.ts b/packages/core/src/tools/shell.test.ts
index f358f972..0dff776f 100644
--- a/packages/core/src/tools/shell.test.ts
+++ b/packages/core/src/tools/shell.test.ts
@@ -514,4 +514,24 @@ describe('ShellTool Bug Reproduction', () => {
undefined,
);
});
+
+ it('should pass GEMINI_CLI environment variable to executed commands', async () => {
+ config = {
+ getCoreTools: () => undefined,
+ getExcludeTools: () => undefined,
+ getDebugMode: () => false,
+ getGeminiClient: () => ({}) as GeminiClient,
+ getTargetDir: () => '.',
+ getSummarizeToolOutputConfig: () => ({}),
+ } as unknown as Config;
+ shellTool = new ShellTool(config);
+
+ const abortSignal = new AbortController().signal;
+ const result = await shellTool.execute(
+ { command: 'echo "$GEMINI_CLI"' },
+ abortSignal,
+ );
+
+ expect(result.returnDisplay).toBe('1\n');
+ });
});