Skip to content

fix(zed-integration): Allow Zed integration to use stdio#13795

Closed
benbrandt wants to merge 2 commits intogoogle-gemini:mainfrom
zed-industries:zed-stdout
Closed

fix(zed-integration): Allow Zed integration to use stdio#13795
benbrandt wants to merge 2 commits intogoogle-gemini:mainfrom
zed-industries:zed-stdout

Conversation

@benbrandt
Copy link
Copy Markdown
Contributor

Summary

#13247 introduced a change that broke the Zed integration's ability to communicate over stdio.

This adds the same functionality for using stdio as the non-interactive mode.

This is urgent as the 0.18 branch will be broken as-is.

How to Validate

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

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

In the command palette, run dev: open acp logs

Start a new prompt and verify that events are going back and forth.

If you do the same on main, you will see it hang, with no initialize response.

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

@benbrandt benbrandt requested a review from a team as a code owner November 25, 2025 10:08
@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 regression in the Zed integration, where a recent change inadvertently broke its ability to communicate via standard input/output (stdio). The fix involves re-introducing the necessary output listeners and flushing logic, ensuring that the Zed integration can properly handle stdio, mirroring the behavior of its non-interactive mode. This is an urgent correction to prevent the 0.18 branch from being non-functional.

Highlights

  • Zed Integration Fix: This pull request resolves a regression in the Zed integration that prevented it from communicating over standard input/output (stdio), which was introduced by a previous change.
  • Restored stdio functionality: The fix re-enables the necessary output listeners and flushing mechanism for the Zed integration, aligning its stdio communication with the non-interactive mode.
  • Urgency for 0.18 branch: The change is critical and urgent for the stability and functionality of the 0.18 branch, which would otherwise be broken.
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.

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 aims to fix an issue with the Zed editor integration where communication over stdio was broken. The proposed change adds a call to initializeOutputListenersAndFlush() to ensure buffered output is flushed, similar to the non-interactive mode. While this correctly addresses the hanging issue, it introduces a critical side effect: it sets up a log event listener that can write to stdout, which would corrupt the protocol stream used by the Zed integration. My review includes a suggestion to remove this problematic listener immediately after its creation, ensuring the fix is robust and doesn't introduce new bugs.

@gsabran
Copy link
Copy Markdown

gsabran commented Nov 25, 2025

Do you think there should be a few integration tests to help Gemini CLI developers who likely don't think about the ACP integration not break it? Something like zed-industries#2

@benbrandt
Copy link
Copy Markdown
Contributor Author

@gsabran you're going to need to follow the steps here, otherwise I'll have to redo you commit myself: https://github.com/google-gemini/gemini-cli/pull/13795/checks?check_run_id=56433695889

@benbrandt
Copy link
Copy Markdown
Contributor Author

@gsabran we'll have to do yours later in another PR once you have signed the CLA

@gsabran
Copy link
Copy Markdown

gsabran commented Nov 27, 2025

Sounds good I'll follow up. Let's keep this fix small

@42piratas
Copy link
Copy Markdown

Can't wait to see this one merged and be able to use Gemini CLI again 🙏🏽🙏🏽🙏🏽

@Rishirandhawa
Copy link
Copy Markdown

Didn't look like anyone at google paying attention to this issue. I have created a patch to fix this. Use it if anyone wants - https://github.com/Rishirandhawa/gemini-cli-acp-patch

@zeon256
Copy link
Copy Markdown

zeon256 commented Dec 2, 2025

I tried git cloning the fork and install gemini-cli from the fork. Can confirm that the fork works for those of you who needs this urgently before it gets merged to main

@inj-src
Copy link
Copy Markdown

inj-src commented Dec 3, 2025

I have been using a local build of Gemini CLI with of this commit and it seems to work fine.. Please merge this pr so that you can use the official version

@benbrandt
Copy link
Copy Markdown
Contributor Author

fixed in #14159

@benbrandt benbrandt closed this Dec 3, 2025
@gsabran gsabran mentioned this pull request Dec 8, 2025
18 tasks
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.

6 participants