Skip to content

fix(core): ensure --yolo does not force headless mode#18976

Merged
galz10 merged 1 commit intomainfrom
ntm/fix-headless-yolo
Feb 13, 2026
Merged

fix(core): ensure --yolo does not force headless mode#18976
galz10 merged 1 commit intomainfrom
ntm/fix-headless-yolo

Conversation

@NTaylorMullen
Copy link
Collaborator

Summary

Fixes a regression where gemini --yolo would incorrectly boot into headless mode instead of the interactive REPL.

Details

PR #18855 added -y and --yolo to the isHeadlessMode detection 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

  1. Run gemini --yolo in a terminal.
  2. Verify it enters the interactive REPL instead of immediately exiting or running in headless mode.
  3. Run npm test -w @google/gemini-cli-core -- src/utils/headless.test.ts to verify all headless detection tests pass.

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any)
  • Validated on required platforms/methods:
    • MacOS
      • npm run

- 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.
@NTaylorMullen NTaylorMullen requested a review from a team as a code owner February 13, 2026 07:47
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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 gemini command-line interface to mistakenly activate headless mode when the --yolo or -y flag was present. The change ensures that these flags, intended for auto-approval, do not interfere with the interactive REPL experience, allowing users to correctly engage with the CLI as intended.

Highlights

  • Regression Fix: Corrected an issue where the gemini CLI would incorrectly enter headless mode when the --yolo or -y flag was used, preventing the interactive REPL from launching.
  • Headless Mode Logic: Modified the isHeadlessMode utility to no longer consider --yolo or -y as indicators for headless operation, recognizing them as approval flags instead.
  • Test Updates: Updated unit tests for isHeadlessMode to reflect the corrected behavior, ensuring that the presence of --yolo or -y no longer asserts headless mode.
Changelog
  • packages/core/src/utils/headless.test.ts
    • Updated test cases to assert that isHeadlessMode() returns false when -y or --yolo flags are present in process.argv.
    • Changed the test description to reflect the new expected behavior for -y and --yolo flags.
  • packages/core/src/utils/headless.ts
    • Removed the -y and --yolo flags from the process.argv check within the isHeadlessMode function, preventing them from triggering headless mode.
Activity
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 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.

@github-actions
Copy link

Size Change: -46 B (0%)

Total Size: 24.4 MB

ℹ️ View Unchanged
Filename Size Change
./bundle/gemini.js 24.4 MB -46 B (0%)
./bundle/sandbox-macos-permissive-open.sb 890 B 0 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB 0 B
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB 0 B
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB 0 B
./bundle/sandbox-macos-strict-open.sb 4.82 kB 0 B
./bundle/sandbox-macos-strict-proxied.sb 5.02 kB 0 B

compressed-size-action

@NTaylorMullen NTaylorMullen added this pull request to the merge queue Feb 13, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 13, 2026
@galz10 galz10 added this pull request to the merge queue Feb 13, 2026
Merged via the queue into main with commit d0c6a56 Feb 13, 2026
28 of 29 checks passed
@galz10 galz10 deleted the ntm/fix-headless-yolo branch February 13, 2026 15:56
@skeshive
Copy link
Contributor

/patch

@github-actions
Copy link

Patch workflow(s) dispatched successfully!

📋 Details:

  • Channels: stable,preview
  • Commit: d0c6a56c65556fc4e1d03b680d38cadb28aa01ec
  • Workflows Created: 2

🔗 Track Progress:

@github-actions
Copy link

🚀 Patch PR Created!

📋 Patch Details:

📝 Next Steps:

  1. Review and approve the hotfix PR: #19023
  2. Once merged, the patch release will automatically trigger
  3. You'll receive updates here when the release completes

🔗 Track Progress:

github-actions bot pushed a commit that referenced this pull request Feb 13, 2026
# Conflicts:
#	packages/core/src/utils/headless.test.ts
#	packages/core/src/utils/headless.ts
@github-actions
Copy link

🚀 Patch PR Created!

📋 Patch Details:

📝 Next Steps:

  1. ⚠️ Resolve conflicts in the hotfix PR first: #19024
  2. Test your changes after resolving conflicts
  3. Once merged, the patch release will automatically trigger
  4. You'll receive updates here when the release completes

🔗 Track Progress:

@github-actions
Copy link

🚀 Patch Release Started!

📋 Release Details:

  • Environment: prod
  • Channel: preview → publishing to npm tag preview
  • Version: v0.29.0-preview.2
  • Hotfix PR: Merged ✅
  • Release Branch: release/v0.29.0-preview.2-pr-18976

⏳ Status: The patch release is now running. You'll receive another update when it completes.

🔗 Track Progress:

@github-actions
Copy link

Patch Release Complete!

📦 Release Details:

🎉 Status: Your patch has been successfully released and published to npm!

📝 What's Available:

🔗 Links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants