Skip to content

fix: remove ask_user tool from non-interactive modes#18154

Merged
jackwotherspoon merged 10 commits intomainfrom
ask-user/headless
Feb 3, 2026
Merged

fix: remove ask_user tool from non-interactive modes#18154
jackwotherspoon merged 10 commits intomainfrom
ask-user/headless

Conversation

@jackwotherspoon
Copy link
Copy Markdown
Collaborator

Summary

Disable ask_user tool for all headless (non-interactive) modes.

The Ask User tool is always interactive, it requires user input so should be disabled in all headless mode (even headless yolo mode)

How to Validate

npm run build
npm start -- --prompt "Ask me some questions"

Questions should be in text and not attempt to use tool.

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

@jackwotherspoon jackwotherspoon requested a review from a team as a code owner February 3, 2026 01:39
@gemini-cli
Copy link
Copy Markdown
Contributor

gemini-cli Bot commented Feb 3, 2026

Hi @jackwotherspoon, thank you so much for your contribution to Gemini CLI! We really appreciate the time and effort you've put into this.

We're making some updates to our contribution process to improve how we track and review changes. Please take a moment to review our recent discussion post: Improving Our Contribution Process & Introducing New Guidelines.

Key Update: Starting January 26, 2026, the Gemini CLI project will require all pull requests to be associated with an existing issue. Any pull requests not linked to an issue by that date will be automatically closed.

Thank you for your understanding and for being a part of our community!

@gemini-cli
Copy link
Copy Markdown
Contributor

gemini-cli Bot commented Feb 3, 2026

Hi there! Thank you for your contribution to Gemini CLI.

To improve our contribution process and better track changes, we now require all pull requests to be associated with an existing issue, as announced in our recent discussion and as detailed in our CONTRIBUTING.md.

This pull request is being closed because it is not currently linked to an issue. Once you have updated the description of this PR to link an issue (e.g., by adding Fixes #123 or Related to #123), it will be automatically reopened.

How to link an issue:
Add a keyword followed by the issue number (e.g., Fixes #123) in the description of your pull request. For more details on supported keywords and how linking works, please refer to the GitHub Documentation on linking pull requests to issues.

Thank you for your understanding and for being a part of our community!

@gemini-cli gemini-cli Bot closed this Feb 3, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @jackwotherspoon, 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 addresses an issue where the 'ask_user' tool, which requires direct user input, could potentially be invoked in non-interactive environments. By implementing a robust exclusion mechanism, the change guarantees that this tool is disabled in all headless operations, thereby preventing unexpected behavior and improving the reliability of automated or background processes. This ensures a more stable experience when running the application in non-interactive modes.

Highlights

  • Consistent Tool Exclusion: Ensured the 'ask_user' tool is consistently excluded in all non-interactive (headless) operational modes, as it requires direct user input.
  • Configuration Logic Update: Updated the core configuration logic to explicitly disable the 'ask_user' tool when an interactive terminal is not detected, regardless of other approval settings.
  • Expanded Unit Tests: Expanded unit tests to verify that 'ask_user' is correctly excluded across various non-interactive scenarios, including different approval modes like 'yolo', 'auto_edit', and 'plan'.
Changelog
  • packages/cli/src/config/config.test.ts
    • Imported ASK_USER_TOOL_NAME for use in test assertions.
    • Modified multiple test cases to include assertions for the exclusion of ASK_USER_TOOL_NAME in various non-interactive configurations (default, auto_edit, plan, yolo, and legacy yolo flag).
    • Updated test descriptions for yolo mode to accurately reflect that ask_user is now specifically excluded, whereas previously no interactive tools were excluded in this mode.
    • Added assertions to confirm ASK_USER_TOOL_NAME is not excluded when the application is running in interactive modes.
  • packages/cli/src/config/config.ts
    • Imported ASK_USER_TOOL_NAME.
    • Implemented logic within the loadCliConfig function to unconditionally add ASK_USER_TOOL_NAME to the extraExcludes list when the interactive flag is false, ensuring it's always disabled in headless environments.
Activity
  • The pull request was created by jackwotherspoon.
  • No review comments or other human activity have been recorded yet.
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.

@jackwotherspoon jackwotherspoon changed the title fix: remove ask_user tool from non-interactive modes fix: remove ask_user tool from non-interactive modes Feb 3, 2026
@gemini-cli
Copy link
Copy Markdown
Contributor

gemini-cli Bot commented Feb 3, 2026

Hi there! Thank you for your contribution to Gemini CLI.

To improve our contribution process and better track changes, we now require all pull requests to be associated with an existing issue, as announced in our recent discussion and as detailed in our CONTRIBUTING.md.

This pull request is being closed because it is not currently linked to an issue. Once you have updated the description of this PR to link an issue (e.g., by adding Fixes #123 or Related to #123), it will be automatically reopened.

How to link an issue:
Add a keyword followed by the issue number (e.g., Fixes #123) in the description of your pull request. For more details on supported keywords and how linking works, please refer to the GitHub Documentation on linking pull requests to issues.

Thank you for your understanding and for being a part of our community!

@gemini-cli gemini-cli Bot closed this Feb 3, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 3, 2026

Size Change: +42 B (0%)

Total Size: 23.7 MB

ℹ️ View Unchanged
Filename Size Change
./bundle/gemini.js 23.7 MB +42 B (0%)
./bundle/sandbox-macos-permissive-closed.sb 1.03 kB 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-closed.sb 3.29 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

compressed-size-action

@gemini-cli gemini-cli Bot added the status/need-issue Pull requests that need to have an associated issue. label Feb 3, 2026
@gemini-cli
Copy link
Copy Markdown
Contributor

gemini-cli Bot commented Feb 3, 2026

Hi there! Thank you for your contribution to Gemini CLI.

To improve our contribution process and better track changes, we now require all pull requests to be associated with an existing issue, as announced in our recent discussion and as detailed in our CONTRIBUTING.md.

This pull request is being closed because it is not currently linked to an issue. Once you have updated the description of this PR to link an issue (e.g., by adding Fixes #123 or Related to #123), it will be automatically reopened.

How to link an issue:
Add a keyword followed by the issue number (e.g., Fixes #123) in the description of your pull request. For more details on supported keywords and how linking works, please refer to the GitHub Documentation on linking pull requests to issues.

Thank you for your understanding and for being a part of our community!

@gemini-cli gemini-cli Bot closed this Feb 3, 2026
Comment thread packages/cli/src/config/config.ts
@jackwotherspoon jackwotherspoon requested a review from jerop February 3, 2026 20:43
Copy link
Copy Markdown
Contributor

@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

Copy link
Copy Markdown
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.

note, plan mode support in non-interactive mode is tracked in #17364

@jackwotherspoon jackwotherspoon added this pull request to the merge queue Feb 3, 2026
Merged via the queue into main with commit d1cde57 Feb 3, 2026
26 checks passed
@jackwotherspoon jackwotherspoon deleted the ask-user/headless branch February 3, 2026 23:50
yuvrajangadsingh pushed a commit to yuvrajangadsingh/gemini-cli that referenced this pull request Feb 4, 2026
sidwan02 pushed a commit to sidwan02/gemini-cli-gemma that referenced this pull request Feb 6, 2026
kuishou68 pushed a commit to iOfficeAI/aioncli that referenced this pull request Feb 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

3 participants