fix: auto-update sandbox regression (#1221)

This commit is contained in:
Eddie Santos
2025-06-19 14:40:10 -07:00
committed by GitHub
parent 619da70070
commit c1486c47ee
2 changed files with 39 additions and 3 deletions

View File

@@ -30,6 +30,11 @@ function isSandboxCommand(value: string): value is SandboxConfig['command'] {
function getSandboxCommand(
sandbox?: boolean | string,
): SandboxConfig['command'] | '' {
// If the SANDBOX env var is set, we're already inside the sandbox.
if (process.env.SANDBOX) {
return '';
}
// note environment variable takes precedence over argument (from command line or settings)
sandbox = process.env.GEMINI_SANDBOX?.toLowerCase().trim() ?? sandbox;
if (sandbox === '1' || sandbox === 'true') sandbox = true;