diff --git a/packages/cli/src/utils/sandbox.test.ts b/packages/cli/src/utils/sandbox.test.ts index 75128457bb..cfb9e21787 100644 --- a/packages/cli/src/utils/sandbox.test.ts +++ b/packages/cli/src/utils/sandbox.test.ts @@ -122,6 +122,9 @@ describe('sandbox', () => { }); afterEach(() => { + // Note: We intentionally avoid vi.restoreAllMocks() here because it clears the top-level + // vi.mock('@google/gemini-cli-core') entirely, making its un-exported constants (like GEMINI_DIR) + // undefined in subsequent tests. Call counts are still reset by clearAllMocks() in beforeEach. process.env = originalEnv; process.argv = originalArgv; }); diff --git a/packages/core/src/utils/constants.ts b/packages/core/src/utils/constants.ts index 5806dc8443..0a725cc3e4 100644 --- a/packages/core/src/utils/constants.ts +++ b/packages/core/src/utils/constants.ts @@ -10,3 +10,4 @@ export const REFERENCE_CONTENT_END = '--- End of content ---'; export const LOCAL_DEV_SANDBOX_IMAGE_NAME = 'gemini-cli-sandbox'; export const SANDBOX_NETWORK_NAME = 'gemini-cli-sandbox'; export const SANDBOX_PROXY_NAME = 'gemini-cli-sandbox-proxy'; +export const GEMINI_DIR = '.gemini';