fix(start): strip CI_* env vars in dev mode to prevent interactive hang#25649
fix(start): strip CI_* env vars in dev mode to prevent interactive hang#25649fuleinist wants to merge 1 commit intogoogle-gemini:mainfrom
Conversation
…de hang When running npm run start with CI_* env vars present (e.g. CI_TOKEN), the is-in-ci package (used by ink) detects them and switches to non-interactive mode, causing the CLI to hang after the ASCII art header. The bundled build handles this via esbuild alias to a stub is-in-ci module, but dev mode bypasses esbuild. This fix strips CI_* vars from the env passed to the child process in scripts/start.js, matching the bundled behavior. Also prints a clear warning so developers know which vars were removed and that they remain available in spawned shell tools. Fixes google-gemini#22452.
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
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 an issue where the development environment incorrectly detects a CI context due to the presence of 'CI_*' environment variables. By filtering these variables out during the startup process, the application is forced into interactive mode, ensuring that the CLI functions as expected locally without hanging. 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 modifies scripts/start.js to filter out environment variables starting with CI_ from the development environment. This change ensures that the ink library remains in interactive mode during development by preventing the detection of a CI environment. I have no feedback to provide.
Summary
When running
npm run startwithCI_*env vars present (e.g.CI_TOKEN), theis-in-cipackage (used byinkUI framework) detects them and switches to non-interactive mode, causing the CLI to hang after the ASCII art header.The bundled build handles this via an esbuild alias to a stub
is-in-cimodule that always returnsfalse. However, dev mode (npm run start) bypasses esbuild, so the realis-in-cipackage is loaded and the hang occurs.Fix
In
scripts/start.js, strip anyCI_*prefixed env vars from theenvobject before spawning the child process — matching the bundled behavior. Also prints a clear warning so developers know which vars were removed and that they remain available in spawned shell tools.Testing
export CI_TOKEN=anythingnpm run startRelated
npm run start) — interactive mode hangs #22452CI_*environment variable is set #1563 (originalis-in-ciissue)