Skip to content

fix(zed-integration): Ensure that the zed integration is classified as interactive - #13394

Merged
skeshive merged 2 commits into
google-gemini:mainfrom
zed-industries:fix-shell-tool-calls-in-non-interactive-mode
Nov 20, 2025
Merged

fix(zed-integration): Ensure that the zed integration is classified as interactive#13394
skeshive merged 2 commits into
google-gemini:mainfrom
zed-industries:fix-shell-tool-calls-in-non-interactive-mode

Conversation

@benbrandt

@benbrandt benbrandt commented Nov 19, 2025

Copy link
Copy Markdown
Contributor

Summary

Shell-based tool calls were always failing because the zed flag wasn't getting marked in the config as an interactive session.

This should allow the tool calls to proceed. This is urgent and most sessions are completely broken if the agent cannot call shell commands.

Related Issues

Closes: zed-industries/zed#41059

How to Validate

Run npm run build and put the following config in your Zed settings.json

{
  "agent_servers": {
    "jimandi": {
      "command": "/path/to/your/repo/gemini-cli/packages/cli/dist/index.js",
      "args": ["--experimental-acp"]
    }
  }
}

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

…s interactive

Shell-based tool calls were always failing because the zed flag wasn't getting marked in the config as an interactive session.

This should allow the tool calls to proceed.
@benbrandt
benbrandt requested a review from a team as a code owner November 19, 2025 10:02
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @benbrandt, 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 a critical bug in the Zed integration where shell-based tool calls were consistently failing. The core issue was that sessions initiated with the experimentalAcp flag were not being correctly identified as interactive. The fix ensures that the presence of this flag properly marks the session as interactive, thereby enabling shell commands to execute as intended and preventing agent sessions from being completely broken.

Highlights

  • Zed Integration Fix: The experimentalAcp flag, used in the Zed integration, is now correctly recognized as indicating an interactive session. This resolves a critical issue where shell-based tool calls were failing due to sessions not being marked as interactive.
  • Simplified Non-Interactive Check: The logic for determining non-interactive sessions has been streamlined. The condition to exclude tools that require a prompt now solely depends on the interactive flag, removing a redundant check for experimentalAcp.
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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 addresses an urgent bug where shell-based tool calls were failing for the Zed integration because the session was not being correctly identified as interactive. The fix, located in packages/cli/src/config/config.ts, is clean and effective. It correctly updates the interactive flag to be true when the --experimental-acp flag is present. The subsequent removal of the now-redundant !argv.experimentalAcp check simplifies the logic for excluding tools in non-interactive modes. The change is minimal, well-targeted, and directly resolves the issue. I find no issues with this implementation.

@skeshive
skeshive enabled auto-merge November 19, 2025 17:04
@skeshive
skeshive disabled auto-merge November 19, 2025 17:10
@skeshive

Copy link
Copy Markdown
Contributor

@benbrandt Doesn't the existing conditional already treat ACP as interactive?

@benbrandt

Copy link
Copy Markdown
Contributor Author

The issue is that interactive is stored in the config later, and this is now used in other places to determine if the shell command can run

@skeshive

Copy link
Copy Markdown
Contributor

The issue is that interactive is stored in the config later, and this is now used in other places to determine if the shell command can run

Ah I missed the change on line 517... lgtm

@skeshive
skeshive enabled auto-merge November 20, 2025 15:12
@skeshive
skeshive added this pull request to the merge queue Nov 20, 2025
Merged via the queue into google-gemini:main with commit 6c126b9 Nov 20, 2025
21 checks passed
thacio added a commit to thacio/auditaria that referenced this pull request Nov 23, 2025
thacio added a commit to thacio/auditaria that referenced this pull request Nov 23, 2025
@gsabran

gsabran commented Nov 24, 2025

Copy link
Copy Markdown

@benbrandt In could not tell if this was related to this exact change, but I noticed that we're not getting anything in stdout since 18.0-preview0:

> echo '{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"protocolVersion":1,"clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false}}}' | node ~/Downloads/v0.17.1.js --experimental-acp

{"jsonrpc":"2.0","id":0,"result":{"protocolVersion":1,"authMethods":[{"id":"oauth-personal","name":"Log in with Google","description":null},{"id":"gemini-api-key","name":"Use Gemini API key","description":"Requires setting the `GEMINI_API_KEY` environment variable"},{"id":"vertex-ai","name":"Vertex AI","description":null}],"agentCapabilities":{"loadSession":false,"promptCapabilities":{"image":true,"audio":true,"embeddedContext":true}}}}

> echo '{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"protocolVersion":1,"clientCapabilities":{"fs":{"readTextFile":false,"writeTextFile":false},"terminal":false,"_meta":{"terminal-auth":true}}}}' | node ~/Downloads/v0.18.0-preview.0.js --experimental-acp

# nothing

@benbrandt

Copy link
Copy Markdown
Contributor Author

I bet this change that fixed the terminals broke the auth flow... Will have to look at it in the morning

@gsabran

gsabran commented Nov 24, 2025

Copy link
Copy Markdown

Yes I bisected it to #13247

mboshernitsan pushed a commit that referenced this pull request Nov 25, 2025
…s interactive (#13394)

Co-authored-by: Shreya Keshive <shreyakeshive@google.com>
@benbrandt

Copy link
Copy Markdown
Contributor Author

@gsabran thanks so much! this helps a ton. Looking now

danpalmer pushed a commit to danpalmer/gemini-cli that referenced this pull request Nov 29, 2025
…s interactive (google-gemini#13394)

Co-authored-by: Shreya Keshive <shreyakeshive@google.com>
cocosheng-g pushed a commit that referenced this pull request May 6, 2026
…s interactive (#13394)

Co-authored-by: Shreya Keshive <shreyakeshive@google.com>
@sripasg sripasg added the size/xs An extra small PR label Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/xs An extra small PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AI: Gemini CLI unable to call shell commands

4 participants