Skip to content

feat(cli): conditionally exclude ask_user tool in ACP mode#23045

Merged
sripasg merged 4 commits intogoogle-gemini:mainfrom
nmcnamara-eng:feat/acp-exclude-ask-user
Mar 20, 2026
Merged

feat(cli): conditionally exclude ask_user tool in ACP mode#23045
sripasg merged 4 commits intogoogle-gemini:mainfrom
nmcnamara-eng:feat/acp-exclude-ask-user

Conversation

@nmcnamara-eng
Copy link
Copy Markdown
Contributor

@nmcnamara-eng nmcnamara-eng commented Mar 19, 2026

Summary

This prevents IDEs from intercepting the ask_user tool call and presenting confusing allow/reject permission dialogs to the user, forcing the model to fallback to plain text conversational queries instead.

Details

  • In packages/cli/src/config/config.ts, the commit lifts the definition of isAcpMode up slightly earlier during the config instantiation. Then, it modifies the fallback exclusions block.
  • Previously, ask_user was only added to ``extraExcludes if the session was non-interactive (!interactive).
  • Now, it is added if the session is non-interactive or if the CLI is starting in ACP mode (!interactive || isAcpMode).
  • Testing: Two unit tests in packages/cli/src/config/config.test.ts to verify that ask_user is excluded when the --acp and /or --experimental-acp initialization argument is passed in interactive mode.

Related Issues

Fixes maintainers-gemini-cli#1573

How to Validate

Cases where Allow/Deny were wrongly asked from user for a opinion/clarification question do not happen anymore.

Pre-Merge Checklist

  • [NA] Updated relevant documentation and README (if needed)
  • [✅] Added/updated tests (if needed)
  • [NA] 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

@nmcnamara-eng nmcnamara-eng requested a review from a team as a code owner March 19, 2026 03:41
@gemini-code-assist
Copy link
Copy Markdown
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 refines the CLI's behavior in Agent-Controlled Process (ACP) mode by intelligently managing tool availability. It addresses a specific interaction issue where IDEs could interfere with the ask_user tool, leading to a suboptimal user experience. By conditionally excluding this tool, the system ensures a more consistent and predictable conversational flow, allowing the model to operate effectively without external interruptions from IDE-specific prompts.

Highlights

  • Conditional ask_user tool exclusion: The ask_user tool is now conditionally excluded when the CLI operates in Agent-Controlled Process (ACP) mode, specifically when the --acp or --experimentalAcp flags are present. This change prevents IDEs from intercepting ask_user calls and presenting disruptive permission dialogs, ensuring a smoother conversational flow where the model defaults to plain text queries.
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.

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-cli gemini-cli bot added the priority/p1 Important and should be addressed in the near term. label Mar 19, 2026
Copy link
Copy Markdown
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 conditionally excludes the ask_user tool when running in ACP mode. This change is well-implemented: the logic in loadCliConfig is updated correctly, and a duplicated variable definition is removed, which improves code clarity. A new test case has also been added to verify that the ask_user tool is excluded as expected. The changes are sound and effectively address the issue described in the pull request.

nmcnamara-eng and others added 2 commits March 19, 2026 13:24
This prevents IDEs like IntelliJ from intercepting the ask_user tool call and presenting confusing allow/reject permission dialogs to the user, forcing the model to fallback to plain text conversational queries instead.
@sripasg sripasg force-pushed the feat/acp-exclude-ask-user branch from f72f650 to 7003f15 Compare March 19, 2026 22:29
@sripasg sripasg added this pull request to the merge queue Mar 19, 2026
@gemini-cli gemini-cli bot added the status/need-issue Pull requests that need to have an associated issue. label Mar 19, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Mar 19, 2026
@sripasg sripasg added the ACP label Mar 20, 2026
@sripasg sripasg added this pull request to the merge queue Mar 20, 2026
Merged via the queue into google-gemini:main with commit 52250c1 Mar 20, 2026
27 checks passed
likhith-adithya added a commit to likhith-adithya/gemini-cli that referenced this pull request Mar 20, 2026
…mini#23045)

Co-authored-by: Sri Pasumarthi <sripas@google.com>
Co-authored-by: Sri Pasumarthi <111310667+sripasg@users.noreply.github.com>
ProthamD pushed a commit to ProthamD/gemini-cli that referenced this pull request Mar 29, 2026
…mini#23045)

Co-authored-by: Sri Pasumarthi <sripas@google.com>
Co-authored-by: Sri Pasumarthi <111310667+sripasg@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ACP priority/p1 Important and should be addressed in the near term. status/need-issue Pull requests that need to have an associated issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants