diff options
| author | Brandon Keiji <[email protected]> | 2025-06-03 19:32:17 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-06-03 19:32:17 +0000 |
| commit | e96fd677ee4234ea17e88ac567c444ae72cc0a7c (patch) | |
| tree | dd446d820394f855c7e7e2539727715a87c2c8b6 | |
| parent | 546e033081259d782c50fe88fedfc820407edde4 (diff) | |
fix: do not try to pull development sandbox image from the internet (#725)
| -rw-r--r-- | packages/cli/src/utils/sandbox.ts | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/packages/cli/src/utils/sandbox.ts b/packages/cli/src/utils/sandbox.ts index 7b734e89..b41dccf5 100644 --- a/packages/cli/src/utils/sandbox.ts +++ b/packages/cli/src/utils/sandbox.ts @@ -16,6 +16,8 @@ import { SETTINGS_DIRECTORY_NAME, } from '../config/settings.js'; +const LOCAL_DEV_SANDBOX_IMAGE_NAME = 'gemini-cli-sandbox'; + /** * Determines whether the sandbox container should be run with the current user's UID and GID. * This is often necessary on Linux systems (especially Debian/Ubuntu based) when using @@ -79,7 +81,7 @@ async function getSandboxImageName(): Promise<string> { return ( process.env.GEMINI_SANDBOX_IMAGE ?? packageJsonConfig?.sandboxImageUri ?? - 'gemini-cli-sandbox' + LOCAL_DEV_SANDBOX_IMAGE_NAME ); } @@ -304,9 +306,10 @@ export async function start_sandbox(sandbox: string) { // stop if image is missing if (!(await ensureSandboxImageIsPresent(sandbox, image))) { - const remedy = gcPath.includes('gemini-code/packages/') - ? 'Try running `BUILD_SANDBOX=1 gemini` or `scripts/build_sandbox.sh` under the gemini-code repo to build it locally, or check the image name and your network connection.' - : 'Please check the image name, your network connection, or notify [email protected] if the issue persists.'; + const remedy = + image === LOCAL_DEV_SANDBOX_IMAGE_NAME + ? 'Try running `npm run build:all` or `npm run build:sandbox` under the gemini-cli repo to build it locally, or check the image name and your network connection.' + : 'Please check the image name, your network connection, or notify [email protected] if the issue persists.'; console.error( `ERROR: Sandbox image '${image}' is missing or could not be pulled. ${remedy}`, ); @@ -571,6 +574,11 @@ async function ensureSandboxImageIsPresent( } console.info(`Sandbox image ${image} not found locally.`); + if (image === LOCAL_DEV_SANDBOX_IMAGE_NAME) { + // user needs to build the image themself + return false; + } + if (await pullImage(sandbox, image)) { // After attempting to pull, check again to be certain if (await imageExists(sandbox, image)) { |
