fix(zed-integration): Allow Zed integration to use stdio
Summary
https://github.com/google-gemini/gemini-cli/pull/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
- [x] Updated relevant documentation and README (if needed)
- [x] Added/updated tests (if needed)
- [x] Noted breaking changes (if any)
- [x] Validated on required platforms/methods:
- [x] MacOS
- [ ] npm run
- [ ] npx
- [ ] Docker
- [ ] Podman
- [ ] Seatbelt
- [ ] Windows
- [ ] npm run
- [ ] npx
- [ ] Docker
- [ ] Linux
- [ ] npm run
- [ ] npx
- [ ] Docker
- [x] MacOS
Summary of Changes
Hello @benbrandt, I'm Gemini Code Assist[^1]! 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 :thumbsup: and :thumbsdown: 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.
[^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.
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 https://github.com/zed-industries/gemini-cli/pull/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
@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 https://github.com/google-gemini/gemini-cli/pull/14159