Skip to content

Conversation

bulkypanda
Copy link
Member

TLDR

Added a --approval-mode parameter to CLI.

Dive Deeper

--yolo can be too much sometimes. --approval-mode supports default, auto_edit, and yolo. based off of #4591

Reviewer Test Plan

launch the cli with --approval-mode=default, --approval-mode=auto_edit, and --approval-mode=yolo parameters.

Testing Matrix

🍏 🪟 🐧
npm run
npx
Docker
Podman - -
Seatbelt - -

Linked issues / bugs

@bulkypanda bulkypanda requested a review from a team as a code owner August 12, 2025 00:15
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.

Summary of Changes

Hello @bulkypanda, 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 a new --approval-mode command-line parameter to provide more granular control over tool call approvals within the CLI. This new parameter aims to unify and replace the existing --yolo flag by offering default, auto_edit, and yolo options, allowing users to specify how tool calls should be approved.

Highlights

  • Enhanced Tool Approval Control: A new --approval-mode CLI parameter has been added, allowing users to choose between default (prompt for each tool call), auto_edit (automatically approve edit tools), and yolo (automatically approve all tool calls).
  • Unified Approval Mechanism: The new --approval-mode parameter is intended to supersede the --yolo flag, with --approval-mode=yolo providing equivalent functionality. Simultaneous use of --yolo and --approval-mode is now explicitly disallowed.
  • Updated Documentation: The CLI configuration documentation has been updated to detail the new --approval-mode parameter and clarify its interaction with the sandboxing feature.
  • Robust Argument Parsing and Testing: The argument parsing logic has been updated to handle the new parameter, including validation for mutually exclusive flags. Comprehensive unit tests have been added to ensure correct behavior and error handling for all approval modes and flag combinations.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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 introduces a new --approval-mode parameter, which is a great step towards more granular control over tool execution. The implementation is mostly solid, with good documentation and argument parsing tests.

However, I've found a critical issue where the new auto_edit mode does not work correctly in non-interactive sessions due to incorrect tool exclusion logic. I've also pointed out that the new test suite for this feature is missing coverage for these non-interactive scenarios, which is likely why this bug was missed.

My feedback focuses on fixing this critical bug and improving test coverage to prevent similar issues in the future.

Copy link
Collaborator

@jacob314 jacob314 left a comment

Choose a reason for hiding this comment

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

Approved once the two hopefully minor comments are addressed. Thanks for the contribution!

@bulkypanda bulkypanda requested a review from jacob314 August 12, 2025 00:36
Copy link
Collaborator

@jacob314 jacob314 left a comment

Choose a reason for hiding this comment

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

lgtm

@jacob314 jacob314 enabled auto-merge August 12, 2025 21:41
auto-merge was automatically disabled August 12, 2025 21:52

Head branch was pushed to by a user without write access

@jacob314 jacob314 enabled auto-merge August 12, 2025 21:56
auto-merge was automatically disabled August 12, 2025 22:02

Head branch was pushed to by a user without write access

@jacob314 jacob314 enabled auto-merge August 12, 2025 22:04
@jacob314 jacob314 added this pull request to the merge queue Aug 12, 2025
Merged via the queue into google-gemini:main with commit 8d6eb8c Aug 12, 2025
14 checks passed
thacio added a commit to thacio/auditaria that referenced this pull request Aug 12, 2025
acoliver pushed a commit to acoliver/llxprt-code that referenced this pull request Aug 14, 2025
acoliver added a commit to acoliver/llxprt-code that referenced this pull request Aug 14, 2025
This merge integrates the following upstream commits from gemini-cli:

SUCCESSFULLY CHERRY-PICKED AND INTEGRATED:
- 22109db: chore(ci): add global linter (google-gemini#6111)
- d219f90: Switch from useInput to useKeypress (google-gemini#6056)
- 3a87712: Launch VS Code IDE Integration (google-gemini#6063)
- 8d6eb8c: feat: add --approval-mode parameter (google-gemini#6024)
- 9d023be: Upgrade integration tests to use Vitest (google-gemini#6021)
- 661ee0a: chore(ci): Ensure e2e workflow security (google-gemini#6098)
- 431a312: Show OpenTelemetry SDK in debug mode only (google-gemini#6096)
- 0e8bbfb: chore: update bash to follow shellcheck (google-gemini#6102)
- 214800c: chore(ci): Ensure ci workflow security (google-gemini#6109)
- d3fda9d: Zed integration schema upgrade (google-gemini#5536)
- f81ccd8: Add usage documentation for IDE integration (google-gemini#6154)
- 74a13fb: Document certificate issue workaround (google-gemini#6157)
- 9c7fb87: Add terminal setup for Shift+Enter/Ctrl+Enter (google-gemini#3289)
- b61a63a: Move errorParsing.ts to core (google-gemini#6159)
- 38876b7: Add support for trustedFolders.json config (google-gemini#6073)
- 904f462: feat(core): Continue declarative tool migration (google-gemini#6114)
- c0c0e9b: feat(core): Migrate read_many_files, shell, web_fetch (google-gemini#6167)
- 8fae227: fix: Prevent duplicate tools after server refresh (google-gemini#5850)
- a90aeb3: chore(build/compiler): Enable strict TS compiler options (google-gemini#6138)

Preserved llxprt features throughout:
- Multi-provider support (OpenAI, Anthropic, Google, Qwen)
- USE_PROVIDER authentication type
- @vybestack/llxprt-code-core package naming
- Extended IDE integration features
- llxprt branding and configuration
- Custom authentication flows

All commits were manually cherry-picked and conflicts resolved to maintain
llxprt's architecture while incorporating upstream improvements.
mahimashanware pushed a commit to mahimashanware/gemini-cli that referenced this pull request Aug 18, 2025
JeongJaeSoon pushed a commit to JeongJaeSoon/gemini-cli that referenced this pull request Aug 21, 2025
Gosling-dude pushed a commit to Gosling-dude/gemini-cli that referenced this pull request Aug 23, 2025
involvex pushed a commit to involvex/gemini-cli that referenced this pull request Sep 11, 2025
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.

Option to accept all edits instead of YOLO
2 participants