fix(zed-integration): Allow Zed integration to use stdio#13795
fix(zed-integration): Allow Zed integration to use stdio#13795benbrandt wants to merge 2 commits intogoogle-gemini:mainfrom
Conversation
Summary of ChangesHello @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
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
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.
|
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 |
|
@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 |
a72076c to
ce1fce8
Compare
|
@gsabran we'll have to do yours later in another PR once you have signed the CLA |
|
Sounds good I'll follow up. Let's keep this fix small |
|
Can't wait to see this one merged and be able to use Gemini CLI again 🙏🏽🙏🏽🙏🏽 |
|
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 |
|
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 |
|
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 |
|
fixed in #14159 |
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 logsStart 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