Skip to content

feat(plan): adapt planning workflow based on complexity of task#20465

Merged
galz10 merged 14 commits intomainfrom
feat/complexity-adaptive-plan-mode
Feb 26, 2026
Merged

feat(plan): adapt planning workflow based on complexity of task#20465
galz10 merged 14 commits intomainfrom
feat/complexity-adaptive-plan-mode

Conversation

@jerop
Copy link
Contributor

@jerop jerop commented Feb 26, 2026

The model selects the appropriate planning level automatically and can escalate during exploration.

Closes #20143
Closes #19312


It's a puzzle why #20322 was merged yet i don't see it in main

@jerop jerop requested review from a team as code owners February 26, 2026 18:42
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @jerop, 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 introduces an adaptive planning workflow to the system's 'Plan Mode.' The core change allows the model to automatically select an appropriate planning level, adjusting the research depth, consultation requirements, and the structure of the implementation plan based on the task's complexity. This enhancement aims to streamline the planning process for simpler tasks while ensuring comprehensive strategies for more complex undertakings, ultimately improving efficiency and responsiveness.

Highlights

  • Adaptive Planning Workflow: The planning process now dynamically adjusts its depth, consultation level, and plan structure based on the complexity of the task, ranging from simple to complex.
  • Refined Plan Mode Prompts: System prompts for 'Plan Mode' have been updated to reflect the new adaptive workflow, clarifying when and how to engage in planning and what kind of plan to expect.
  • Updated Documentation: The plan-mode.md documentation has been revised to detail the new adaptive planning workflow, providing clear guidelines for different task complexities.
Changelog
  • docs/cli/plan-mode.md
    • Introduced an adaptive planning workflow based on task complexity (Simple, Standard, Complex).
    • Detailed varying consultation depths for different task complexities.
    • Outlined distinct plan structures required for Simple, Standard, and Complex tasks.
  • packages/core/src/core/snapshots/prompts.test.ts.snap
    • Updated the description of the plan mode goal to remove the word "detailed".
    • Revised the rules for when to use enter_plan_mode and exit_plan_mode.
    • Replaced the static "Required Plan Structure" section with a new "Planning Workflow" section detailing adaptive steps.
  • packages/core/src/core/prompts.test.ts
    • Modified the test assertion for the core system prompt to align with the updated conditions for entering plan mode.
  • packages/core/src/prompts/snippets.ts
    • Adjusted the plan mode prompt text, removing "detailed" from the plan goal.
    • Updated rules for read-only operations and direct code modification.
    • Replaced the fixed "Required Plan Structure" with a new "Planning Workflow" section that outlines adaptive consultation and drafting steps.
    • Revised the suggestion for enter_plan_mode usage within the workflowStepResearch function.
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.

@github-actions
Copy link

github-actions bot commented Feb 26, 2026

Size Change: -231 B (0%)

Total Size: 25.7 MB

ℹ️ View Unchanged
Filename Size Change
./bundle/gemini.js 25.2 MB -231 B (0%)
./bundle/node_modules/@google/gemini-cli-devtools/dist/client/main.js 221 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/_client-assets.js 227 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/index.js 11.5 kB 0 B
./bundle/node_modules/@google/gemini-cli-devtools/dist/src/types.js 132 B 0 B
./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

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 introduces an adaptive planning workflow for Plan Mode, where the depth of research, consultation, and plan structure are proportional to the task's complexity. The changes update the system prompts to guide the model in assessing complexity and generating appropriate plans for simple, standard, and complex tasks. The documentation for Plan Mode has also been updated to reflect this new workflow. My review found a minor inconsistency between the updated documentation and the system prompt regarding the plan structure for complex tasks. The documentation is missing a couple of sections, which could lead to user confusion. I've suggested a fix to align the documentation with the prompt.

@gemini-cli gemini-cli bot added the 🔒 maintainer only ⛔ Do not contribute. Internal roadmap item. label Feb 26, 2026
jerop added 12 commits February 26, 2026 14:34
Add a `complexity` parameter (minimal, standard, thorough) to
`enter_plan_mode` that controls plan structure, workflow steps,
and required sections. The model selects the appropriate level
automatically and can escalate during exploration.

- Minimal: 2-section plan (Changes, Verification), 3-step workflow
- Standard: 3-section plan (Objective, Implementation Plan, Verification), 4-step workflow
- Thorough: 7-section design-doc style plan, 5-step workflow with mandatory user consultation
- Add PlanComplexity enum in plan/types.ts
- Store/reset complexity on Config across mode transitions
- Add adaptive auto-detection and escalation in system prompt
- Add complexity selection evals
- Update docs with complexity table
@jerop jerop force-pushed the feat/complexity-adaptive-plan-mode branch from 1729a19 to 83c72dc Compare February 26, 2026 19:34
@galz10 galz10 enabled auto-merge February 26, 2026 22:20
@galz10 galz10 added this pull request to the merge queue Feb 26, 2026
Merged via the queue into main with commit aa98caf Feb 26, 2026
27 checks passed
@galz10 galz10 deleted the feat/complexity-adaptive-plan-mode branch February 26, 2026 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔒 maintainer only ⛔ Do not contribute. Internal roadmap item.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Agent] Plan Mode is to eager to start implementation [Agent] main agent is very persistent about entering plan mode when creating hello world app

2 participants