fix(core): ensure --yolo does not force headless mode#18976
Conversation
- Fix regression introduced in #18855 where YOLO mode flags were incorrectly identified as headless mode indicators. - Update headless mode tests to verify that --yolo remains interactive in a TTY environment.
Summary of ChangesHello @NTaylorMullen, 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 regression that caused 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 addresses a regression where the --yolo flag incorrectly triggered headless mode. The fix involves removing the -y and --yolo flags from the isHeadlessMode detection logic, which is the correct approach as these flags relate to approval mode, not the interactivity of the environment. The changes are well-implemented, and the corresponding tests have been updated to validate the corrected behavior. This is a good fix that restores the intended functionality.
|
Size Change: -46 B (0%) Total Size: 24.4 MB ℹ️ View Unchanged
|
|
/patch |
|
✅ Patch workflow(s) dispatched successfully! 📋 Details:
🔗 Track Progress: |
|
🚀 Patch PR Created! 📋 Patch Details:
📝 Next Steps:
🔗 Track Progress: |
# Conflicts: # packages/core/src/utils/headless.test.ts # packages/core/src/utils/headless.ts
|
🚀 Patch PR Created! 📋 Patch Details:
📝 Next Steps:
🔗 Track Progress: |
|
🚀 Patch Release Started! 📋 Release Details:
⏳ Status: The patch release is now running. You'll receive another update when it completes. 🔗 Track Progress: |
|
✅ Patch Release Complete! 📦 Release Details:
🎉 Status: Your patch has been successfully released and published to npm! 📝 What's Available:
🔗 Links: |
Summary
Fixes a regression where
gemini --yolowould incorrectly boot into headless mode instead of the interactive REPL.Details
PR #18855 added
-yand--yoloto theisHeadlessModedetection logic. This caused the CLI to believe it was in a non-interactive environment whenever the YOLO flag was present, even if running in a TTY. This PR removes those flags from the detection logic as YOLO is an approval mode, not an environment indicator.Related Issues
Fixes a regression introduced in #18855.
How to Validate
gemini --yoloin a terminal.npm test -w @google/gemini-cli-core -- src/utils/headless.test.tsto verify all headless detection tests pass.Pre-Merge Checklist