-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Fix: Prevent freezing in non-interactive Gemini CLI when debug mode is enabled #14580
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @parthasaradhie, 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 resolves an issue where the Gemini CLI would hang indefinitely in non-interactive environments, such as scripting or CI/CD pipelines, when the 'DEBUG' environment variable was present. The changes streamline how debug mode is detected and activated, preventing the CLI from attempting to connect a debugger in headless contexts and thus ensuring smooth execution. 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. 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request addresses a critical issue where the CLI could hang in non-interactive environments by making the debug flag activation more specific. My review focuses on two points: first, a potential over-correction that removes a debugging feature which could be preserved while still fixing the bug. Second, an inconsistency in comparison operators between the modified files. The suggested changes aim to fix the bug without losing functionality and improve code consistency.
|
Size Change: +70 B (0%) Total Size: 21.5 MB ℹ️ View Unchanged
|
…s enabled The CLI would hang indefinitely when the '--debug' or '-d' flag was used in non-interactive (e.g., scripting) mode. This was becauseof waiting for debugger to connect. This change ensures that the debug output mechanism does not block the process flow in headless environments.
304b668 to
fd018b9
Compare
|
/gemini review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request addresses a bug that causes the Gemini CLI to freeze in non-interactive mode when debugging is enabled. The fix involves changing the check for the DEBUG environment variable to be more specific, looking for 'true' or '1' instead of just its presence. This is a good change that correctly targets the intended debug activation. I have one suggestion to improve the maintainability of the new logic by reducing code duplication.
Details
The CLI would hang indefinitely when the DEBUG env is used in non-interactive (e.g., scripting) mode. This was because of waiting for debugger to connect. This change ensures that the debug output mechanism does not block the process flow in headless environments.
Related Issues
Fixes google-github-actions/run-gemini-cli#337
How to Validate
check release-with-gemini.yaml workflow in https://github.com/parthasaradhie/run-gemini-cli/ repo
Action with issue: https://github.com/parthasaradhie/hello-world-rpm/actions/runs/19957624845/job/57230133922
shows
Action with issue fixed :
https://github.com/parthasaradhie/hello-world-rpm/actions/runs/19964069457