Skip to content

Comments

fix(plan): exclude EnterPlanMode tool from YOLO mode#19570

Merged
jerop merged 2 commits intomainfrom
fix/exclude-plan-mode-from-yolo
Feb 20, 2026
Merged

fix(plan): exclude EnterPlanMode tool from YOLO mode#19570
jerop merged 2 commits intomainfrom
fix/exclude-plan-mode-from-yolo

Conversation

@Adib234
Copy link
Contributor

@Adib234 Adib234 commented Feb 19, 2026

Summary

Exclude EnterPlanMode tool from YOLO mode to prevent it from becoming too interactive, which defeats the purpose of YOLO mode.

Details

  • Modified Config.setApprovalMode to trigger system instruction updates and tool synchronization when transitioning to/from YOLO mode.
  • Updated Config.syncPlanModeTools to avoid registering EnterPlanModeTool if the current mode is YOLO.
  • Updated documentation in docs/cli/plan-mode.md and docs/tools/planning.md to reflect this restriction.
  • Added unit tests in packages/core/src/config/config.test.ts to verify that the tool is not registered in YOLO mode and that system instructions are updated correctly.

Related Issues

Closes #19569

How to Validate

  • Run unit tests: npm test -w @google/gemini-cli-core -- src/config/config.test.ts
  • Manually verify that when in YOLO mode, the enter_plan_mode tool is not available in the tool registry.

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

@Adib234 Adib234 requested review from a team as code owners February 19, 2026 21:16
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Adib234, 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 enhances the behavior of YOLO mode by ensuring that the EnterPlanMode tool is not available, thereby preserving the intended non-interactive experience. It also refines the configuration management to correctly synchronize system instructions and tool availability when switching into or out of YOLO mode, aligning its transition logic with that of Plan Mode.

Highlights

  • YOLO Mode Restriction: The EnterPlanMode tool is now explicitly excluded from YOLO mode to maintain its non-interactive nature.
  • Configuration Updates: The Config.setApprovalMode method was updated to trigger system instruction and tool synchronization when transitioning to or from YOLO mode, similar to Plan Mode transitions.
  • Tool Synchronization Logic: The Config.syncPlanModeTools method was modified to prevent the registration of EnterPlanModeTool if the current approval mode is YOLO.
  • Documentation Updates: Relevant documentation in docs/cli/plan-mode.md and docs/tools/planning.md has been updated to reflect that Plan Mode and its entry tool are not available in YOLO mode.
  • Unit Tests: New unit tests were added to packages/core/src/config/config.test.ts to verify that the EnterPlanModeTool is not registered in YOLO mode and that system instructions are updated correctly during YOLO mode transitions.
Changelog
  • docs/cli/plan-mode.md
    • Added a note indicating that Plan Mode is not available when the CLI is in YOLO mode.
  • docs/tools/planning.md
    • Added a note indicating that the enter_plan_mode tool is not available when the CLI is in YOLO mode.
  • packages/core/src/config/config.test.ts
    • Added a test case to verify that system instructions are updated when entering YOLO mode.
    • Updated an existing test description to include non-YOLO modes.
    • Added a test case to ensure EnterPlanModeTool is not registered when in YOLO mode, even if planning is enabled.
  • packages/core/src/config/config.ts
    • Modified setApprovalMode to trigger syncPlanModeTools and updateSystemInstructionIfInitialized for YOLO mode transitions.
    • Refactored syncPlanModeTools to include checks for YOLO mode and prevent EnterPlanModeTool registration when in YOLO 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.

@Adib234 Adib234 self-assigned this Feb 19, 2026
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 correctly excludes the EnterPlanMode tool when in YOLO mode, which aligns with YOLO mode's non-interactive purpose. The changes are well-implemented: setApprovalMode now correctly triggers tool synchronization on YOLO mode transitions, and syncPlanModeTools contains the necessary logic to prevent the tool from being registered. The accompanying documentation updates and new unit tests are thorough and ensure the change is both well-described and correctly verified. The code quality is good, and I have no further recommendations.

@github-actions
Copy link

github-actions bot commented Feb 19, 2026

Size Change: +325 B (0%)

Total Size: 24.5 MB

ℹ️ View Unchanged
Filename Size Change
./bundle/gemini.js 24.5 MB +325 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

@Adib234 Adib234 changed the title fix(core): exclude EnterPlanMode tool from YOLO mode fix(plan): exclude EnterPlanMode tool from YOLO mode Feb 19, 2026
@gemini-cli gemini-cli bot added area/core Issues related to User Interface, OS Support, Core Functionality 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item. labels Feb 19, 2026
@jerop jerop added this pull request to the merge queue Feb 19, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 19, 2026
@Adib234 Adib234 added this pull request to the merge queue Feb 20, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 20, 2026
@Adib234 Adib234 enabled auto-merge February 20, 2026 00:55
@jerop jerop disabled auto-merge February 20, 2026 01:42
@jerop jerop added this pull request to the merge queue Feb 20, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 20, 2026
@jerop jerop added this pull request to the merge queue Feb 20, 2026
Merged via the queue into main with commit 5fd5573 Feb 20, 2026
27 checks passed
@jerop jerop deleted the fix/exclude-plan-mode-from-yolo branch February 20, 2026 02:08
@PhilosophiMoonbeam
Copy link

This feels well-meaning but anti-pattern, entering Plan Mode with auto approval and no user input would be more correct.

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

Labels

area/core Issues related to User Interface, OS Support, Core Functionality 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Tools] Exclude EnterPlanMode from yolo mode

3 participants