Skip to content

feat(plan): support project exploration without planning when in plan mode - #18992

Merged
Adib234 merged 11 commits into
mainfrom
adibakm/no-planning-plan-mode
Feb 17, 2026
Merged

feat(plan): support project exploration without planning when in plan mode#18992
Adib234 merged 11 commits into
mainfrom
adibakm/no-planning-plan-mode

Conversation

@Adib234

@Adib234 Adib234 commented Feb 13, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR updates the Plan Mode instructions to distinguish between Inquiries and Directives. It enables the agent to answer informational requests (Inquiries) directly using read-only tools without requiring a formal implementation plan or approval. This improves efficiency by reducing unnecessary overhead for non-modifying tasks while maintaining strict planning workflows for code-changing actions (Directives).

Details

  • Instruction Refinement: Updated packages/core/src/prompts/snippets.ts and snippets.legacy.ts to include logic for handling inquiries (e.g., "How does X work?") separately from directives (e.g., "Fix bug Y").
  • Workflow Optimization: Inquiries now allow the agent to skip the drafting and approval phases, providing direct answers in the chat response while still restricted to read-only tools.
  • Consistency: Ensured that the "Plan Mode" constraints (read-only access, no source code modification) remain enforced across all request types.

Related Issues

Fixes #18913

How to Validate

In this branch the CLI should be able to tell the difference between a directive and an inquiry. For an inquiry it should never start creating a plan or call ExitPlanMode tool or a directive it should begin creating the plan or clarify.

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
      • npx
      • Docker
      • Podman
      • Seatbelt
    • Windows
      • npm run
      • npx
      • Docker
    • Linux
      • npm run
      • npx
      • Docker

@Adib234 Adib234 self-assigned this Feb 13, 2026
@gemini-code-assist

Copy link
Copy Markdown
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 refines the agent's 'Plan Mode' by introducing a clear differentiation between informational inquiries and actionable directives. This enhancement allows the agent to respond directly to read-only requests without engaging in a formal planning process, thereby streamlining interactions and improving efficiency for non-modifying tasks, while ensuring that code-changing operations still adhere to rigorous planning and approval protocols.

Highlights

  • Enhanced Plan Mode Logic: The agent's 'Plan Mode' now intelligently distinguishes between 'Inquiries' (informational requests) and 'Directives' (actionable tasks requiring code changes).
  • Streamlined Inquiry Handling: Inquiries can now be answered directly by the agent using read-only tools, bypassing the traditional planning and approval phases, which significantly improves efficiency for non-modifying tasks.
  • Maintained Directive Workflow: Directives, which involve modifying source code, continue to follow the established strict planning and approval workflows to ensure careful execution.
  • Updated Prompt Instructions: The core prompt instructions in snippets.ts and snippets.legacy.ts have been updated to guide the agent in applying this new inquiry/directive distinction.
  • New Test Coverage: New test cases have been added to prompts.test.ts to validate the correct handling of inquiries within Plan Mode for both current and legacy models.
Changelog
  • packages/core/src/core/snapshots/prompts.test.ts.snap
    • Updated snapshot content to reflect new prompt instructions for inquiry handling in Plan Mode.
  • packages/core/src/core/prompts.test.ts
    • Added new test cases to verify Plan Mode prompt instructions, specifically for inquiry handling in both current and legacy models.
  • packages/core/src/prompts/snippets.legacy.ts
    • Modified prompt instructions to differentiate between inquiries and directives, allowing direct answers for inquiries in Plan Mode.
    • Updated workflow phases and constraints to explicitly mention handling of inquiries.
  • packages/core/src/prompts/snippets.ts
    • Updated prompt rules to define and handle inquiries and directives, enabling direct responses for inquiries and refining the planning workflow.
    • Modified the workflow section to include specific steps for handling inquiries versus directives.
    • Added a new 'Expertise & Intent Alignment' section to the main prompt, clarifying the distinction between Directives and Inquiries.
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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 introduces an excellent optimization to Plan Mode by distinguishing between 'Inquiries' and 'Directives'. The changes allow the agent to handle informational requests more efficiently by answering them directly with read-only tools, without needing to generate a formal plan. The prompt updates in snippets.ts and snippets.legacy.ts are clear and consistent, and the corresponding tests and snapshots have been correctly updated. The implementation is solid and aligns perfectly with the goals outlined in the description.

@github-actions

github-actions Bot commented Feb 13, 2026

Copy link
Copy Markdown

Size Change: +479 B (0%)

Total Size: 24.4 MB

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

@gemini-cli gemini-cli Bot added area/core Issues related to User Interface, OS Support, Core Functionality area/agent Issues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Quality 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item. labels Feb 13, 2026
@Adib234
Adib234 marked this pull request as ready for review February 13, 2026 16:00
@Adib234
Adib234 requested a review from a team as a code owner February 13, 2026 16:00
Comment thread packages/core/src/prompts/snippets.legacy.ts
Comment thread packages/core/src/prompts/snippets.ts Outdated
…ying the rule declared for inquiries and directives in system prompt
@Adib234
Adib234 enabled auto-merge February 17, 2026 15:36
Comment thread packages/core/src/prompts/snippets.ts Outdated
@Adib234
Adib234 added this pull request to the merge queue Feb 17, 2026
Merged via the queue into main with commit 14aabbb Feb 17, 2026
27 checks passed
@Adib234
Adib234 deleted the adibakm/no-planning-plan-mode branch February 17, 2026 17:02
kuishou68 pushed a commit to iOfficeAI/gemini-cli-pro that referenced this pull request Feb 27, 2026
tripleyoung pushed a commit to tripleyoung/gemini-cli that referenced this pull request Feb 27, 2026
tripleyoung pushed a commit to tripleyoung/gemini-cli that referenced this pull request Feb 27, 2026
liamhelmer pushed a commit to badal-io/gemini-cli that referenced this pull request Mar 12, 2026
@sripasg sripasg added the size/m A medium sized PR label Jun 2, 2026
software-0ficial pushed a commit to software-0ficial/gemini-cli that referenced this pull request Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/agent Issues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Quality area/core Issues related to User Interface, OS Support, Core Functionality 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item. size/m A medium sized PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Agent] Support project exploration without planning when in plan mode

3 participants