-
Notifications
You must be signed in to change notification settings - Fork 8k
feat: add --approval-mode parameter #6024
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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
-
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. ↩
There was a problem hiding this 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.
There was a problem hiding this 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!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Head branch was pushed to by a user without write access
Head branch was pushed to by a user without write access
Co-authored-by: Jacob Richman <[email protected]>
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.
Co-authored-by: Jacob Richman <[email protected]>
Co-authored-by: Jacob Richman <[email protected]>
Co-authored-by: Jacob Richman <[email protected]>
Co-authored-by: Jacob Richman <[email protected]>
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
Linked issues / bugs