Skip to content

feat(plan): support annotating plans with feedback for iteration#20876

Merged
jerop merged 6 commits intomainfrom
feat/plan-annotation-cycle
Mar 2, 2026
Merged

feat(plan): support annotating plans with feedback for iteration#20876
jerop merged 6 commits intomainfrom
feat/plan-annotation-cycle

Conversation

@Adib234
Copy link
Contributor

@Adib234 Adib234 commented Mar 2, 2026

Summary

This PR expands the exit_plan_mode functionality to allow users to easily tell the agent to review an annotated plan. This implements the "annotation cycle" where users can edit a plan file with inline feedback and seamlessly instruct the agent to review those edits instead of approving the plan.

Details

  • Added a new Review option to the ApprovalOption enum in ExitPlanModeDialog.tsx.
  • Updated the AskUserDialog in ExitPlanModeDialog.tsx to include the "No, review plan edits as feedback" option.
  • When the Review option is selected, the CLI sends a hardcoded feedback message to the agent: "I have annotated the plan with feedback. Please review the edited plan file and update the plan accordingly."
  • Updated docs/cli/plan-mode.md to document this new capability in the "Planning Workflow" section.
  • Added comprehensive unit tests in ExitPlanModeDialog.test.tsx to verify the new flow and updated existing tests to account for the UI changes.

Related Issues

Fixes #20461

How to Validate

  1. Start the CLI: npm run start
  2. Enter plan mode: Ask for a plan to add a new command
  3. Once the plan is presented, press Ctrl+X to open the plan file in your preferred editor.
  4. Add some inline annotations or feedback in the plan file, save, and close the editor.
  5. In the CLI dialog, select the new option: No, review plan edits as feedback.
  6. Verify that the agent receives the feedback and iterates on the plan based on your annotations.

Alternatively, run the unit tests:
npm test -w @google/gemini-cli -- src/ui/components/ExitPlanModeDialog.test.tsx

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 requested review from a team as code owners March 2, 2026 19:41
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, 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 significantly enhances the CLI's plan mode by introducing an 'annotation cycle,' allowing users to provide inline feedback and annotations directly within a plan file. Instead of simply approving or rejecting a plan, users can now instruct the agent to review these edits, fostering a more interactive and collaborative approach to plan refinement. This new capability streamlines the process of guiding the agent through complex tasks by enabling direct feedback loops and iterative plan development.

Highlights

  • New Plan Review Workflow: Introduced a new 'Review' option in the exit_plan_mode dialog, enabling users to send annotated plans back to the agent for iteration.
  • Automated Feedback Submission: Implemented logic to send a predefined feedback message to the agent when the 'Review' option is chosen, streamlining the feedback process.
  • Documentation Update: Updated the CLI documentation (docs/cli/plan-mode.md) to describe the new plan review workflow and its benefits.
  • Enhanced Test Coverage: Expanded unit tests (ExitPlanModeDialog.test.tsx) to cover the new 'Review' option and adjusted existing tests to account for UI changes.
Changelog
  • docs/cli/plan-mode.md
    • Documented the new 'Review edits' option in the planning workflow section.
  • package-lock.json
    • Updated dependency metadata by adding 'peer: true' to several package entries.
  • packages/cli/src/ui/components/ExitPlanModeDialog.test.tsx
    • Added new test cases to verify the functionality of the 'Review' option.
    • Adjusted existing test navigation to accommodate the newly added UI option.
  • packages/cli/src/ui/components/ExitPlanModeDialog.tsx
    • Added the 'Review' option to the ApprovalOption enum.
    • Integrated the 'Review' option into the AskUserDialog component.
    • Implemented the logic to send a hardcoded feedback message when the 'Review' option is selected.
  • packages/cli/src/ui/components/snapshots/ExitPlanModeDialog.test.tsx.snap
    • Updated UI snapshots to reflect the addition of the 'No, review plan edits as feedback' option in the exit plan mode dialog.
Activity
  • No human activity (comments, reviews, etc.) was provided in the context.
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 Mar 2, 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 adds a new 'Review' option to the plan approval dialog, allowing users to have the agent iterate on an annotated plan. The implementation is well-tested and the documentation is updated. However, there is an architectural issue where a prompt string is hardcoded in the UI package (packages/cli) instead of the packages/core package, which violates the project's defined separation of concerns. The existing comment addresses this issue and is kept as is, as it does not contradict any of the provided rules.

@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 Mar 2, 2026
@github-actions
Copy link

github-actions bot commented Mar 2, 2026

Size Change: +181 B (0%)

Total Size: 25.8 MB

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

@jerop jerop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to keep the UI simple by not adding a third option, is it possible for us to tell agent to review plan again before presenting it for approval after manual edits using Ctrl + X

@jerop jerop added this pull request to the merge queue Mar 2, 2026
Merged via the queue into main with commit 01927a3 Mar 2, 2026
27 checks passed
@jerop jerop deleted the feat/plan-annotation-cycle branch March 2, 2026 23:17
BryanBradfo pushed a commit to BryanBradfo/gemini-cli that referenced this pull request Mar 5, 2026
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.

Support annotating plans with feedback for iteration

2 participants