fix(cli): treat SANDBOX=0/false as not inside sandbox#21601
fix(cli): treat SANDBOX=0/false as not inside sandbox#21601MohammedADev wants to merge 10 commits into
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical bug in the CLI's sandbox configuration where non-empty string values for the Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request correctly addresses a bug where SANDBOX values of '0' or 'false' were improperly treated as being inside a sandbox. The logic change is sound and is accompanied by a new test case that validates the fix. My review includes one suggestion to align the new test with the repository's testing conventions.
|
Hi everyone, bumping this PR for code owner review #21601 This has been pending for ~2 weeks and is currently blocked on required maintainer approval. All prior feedback has been addressed and the branch is up to date. Could someone take a look when available? Thanks in advance! |
|
Hi there! Thank you for your interest in contributing to Gemini CLI. To ensure we maintain high code quality and focus on our prioritized roadmap, we have updated our contribution policy (see Discussion #17383). We only guarantee review and consideration of pull requests for issues that are explicitly labeled as 'help wanted'. All other community pull requests are subject to closure after 14 days if they do not align with our current focus areas. For this reason, we strongly recommend that contributors only submit pull requests against issues explicitly labeled as 'help-wanted'. This pull request is being closed as it has been open for 14 days without a 'help wanted' designation. We encourage you to find and contribute to existing 'help wanted' issues in our backlog! Thank you for your understanding and for being part of our community! |
Summary
Fixes sandbox initialization logic so
SANDBOX='0'andSANDBOX='false'are not treated as “already inside sandbox”.before any non-empty SANDBOX value short circuited the sandbox setup. This could unintentionally bypass explicit sandbox requests (for example, GEMINI_SANDBOX='docker').
Details
Root cause
In
packages/cli/src/config/sandboxConfig.ts, the inside-sandbox guard used a generic truthy check:if (process.env['SANDBOX']) return ''Because
'0'is a non-empty string, it evaluated truthy and incorrectly disabled sandbox initialization.Related Issues
fixes #21600
How to Validate
npm run test --workspace @google/gemini-cli -- src/config/sandboxConfig.test.ts
Confirm test passes, including:
should not treat SANDBOX='0' as already inside sandbox
Optional manual behavior check if you want,
Set SANDBOX=0
Set GEMINI_SANDBOX=docker
Confirm sandbox config no longer gets skipped due to the inside the sandbox guard.
Pre-Merge Checklist