fix(dev): scrub CI env vars when running locally - #25287
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 improves the local development experience by preventing CI-specific environment variables from interfering with interactive processes. By automatically scrubbing these variables upon startup, the script ensures a more consistent local environment, while still providing an opt-out mechanism for specific use cases. Highlights
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. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request updates scripts/start.js to automatically scrub CI-related environment variables (such as CI, CONTINUOUS_INTEGRATION, and those starting with CI_) from the environment configuration unless the --no-interactive-check flag is provided. This change ensures the CLI can operate in interactive mode even when detected in a CI environment, while providing console feedback about the removed variables. I have no feedback to provide as there were no review comments.
|
Hi @aniruddhaadak80 — quick heads-up: I opened a near-identical PR (#26838) for #22452 yesterday without first searching for prior PRs, my bad. I'm closing mine in favor of this one since you got there first. While iterating on #26838 with a reviewer I picked up two correctness points that I think also apply here — sharing them so you can roll them in if you agree: 1. Scope can be narrowed to const check = (key) => key in env && env[key] !== '0' && env[key] !== 'false';
const isInCi = check('CI') || check('CONTINUOUS_INTEGRATION');There is no 2. Mirror 3. Warning copy. The line "These variables are still available in processes spawned by shell tools" doesn't match the implementation — once the var is If it helps, the post-review diff I had landed in #26838 covers points 1+2+3 and is happy to be cherry-picked or just used as reference: https://github.com/google-gemini/gemini-cli/pull/26838/files No urgency from my side — just wanted to leave the trail for whoever picks this up next. |
|
closing in favor of #27159 |
Resolves #22452. In dev mode (
npm run start), the CLI silently hangs if any environment variable with aCI_prefix is set. This checks and ignores them during bootstrap.