Zed integration
This PR adds tight integration between Zed and Codex using an experimental "ACP" (Agent-client protocol) built on the existing support for MCPs.
The primary features we want to provide are a more native-feeling UI than the terminal, and the ability to use Zed's built-in review feature to approve/deny agent edits.
There are a few areas we changed:
- In core, we added the ability to express low-level operations (asking for permission, reading/writing files) using MCP tool calls. This lets us ensure that the Agent sees any unsaved changes from the user, and the user can review the Agent's changes.
- In the MCP server, we added two new tools "acp/new_session" to start a new agent interaction, and "acp/prompt" to send a new message. These tools use the existing MCP content types to communicate with the agent; in response the agent will send notifications so that we can keep the UI up-to-date.
In the future we'd like to make the integration even tighter: you could imagine acp/load_session to load from history, or even being able to work with the agent directly in a "pairing"-like mod.
All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.
I have read the CLA Document and I hereby sign the CLA
I have read the CLA Document and I hereby sign the CLA
bump on this one, would be super nice as a zed user!
this would be really cool to have! and would solve most of my workflow issues!
I know no maintainers like bumping, nonetheless, here's a bump.
shameless bump :) really cant wait for this
Getting onto a paid plan once this lands so yeah, bump.
There is little point in bumping this right now, as it does not work yet. ACP has moved quite a bit since the PR was started last month, and so has codex, so we'll need a bit more patience until Agus has time to revisit it. (I tried to check out the branch and install it as a custom agent_server without any luck)
This would be really nice. Not only would Zed users benefit from this but also Neovim users via the CodeCompanion plugin ❤️
@agu-z Any chance you will have some time to revisit this PR ?
I have a wip version at https://github.com/openai/codex/compare/main...maan2003:codex:ma/ovkvm
Bump :)
- [x] Gemini
- [x] Claude Code
- [ ] Codex
https://zed.dev/blog/bring-your-own-agent-to-zed https://zed.dev/blog/claude-code-via-acp
Bump
we don't need bumps every 15 minutes, just a leave a :+1:
Bump
has anyone been able to fix the conflicts? as this is prety much done.
@gpeal Apologies for the notification. It appears that this PR has gotten burried a bit. Lots of us Zed(itor) users are eagerly awaiting the merge of this PR so that we can integrate Codex into our workflow.
Would you be able to make this PR visible internally so that it has a chance of being merged?
Since this PR was originally proposed, a few things have happened:
- We have invested more in
codex mcp, which is now a bit of a misnomer, as it spins up a general "app server that speaks JSON-RPC." - As you have probably seen, this is used to power the UI of our new/refreshed VS Code extension: https://marketplace.visualstudio.com/items?itemName=openai.chatgpt.
We would prefer to evolve our protocol for codex mcp as needed to support things like our VS Code extension, though we would be willing to consider PRs for new request/response/notification types to https://github.com/openai/codex/blob/main/codex-rs/protocol/src/mcp_protocol.rs to support others who want to build interfaces on top of our core. (I think this JSON-RPC is more principled API than what is exposed via codex proto today, which I will likely delete in the near future.)
I think an adapter to Zed's ACP should live outside of this project.
Incidentally, while I expect Zed is more interested in the Rust API than the TypeScript one, FYI, we have a "hidden" subcommand, codex generate-ts, for generating the TypeScript types for codex mcp, though it's still somewhat experimental.
So ahat does this mean in english for us people that are desperatlt waitimg for codex integration
So ahat does this mean in english for us people that are desperatlt waitimg for codex integration
As I understand it, integration of an agent with Zed depends on the agent speaking ACP. I think what @bolinfest is saying OpenAI doesn't want to support ACP (at least not at this stage) and if a person wants Codex to support ACP, they should write an adapter on top of the MCP support that Codex has. This adapter could live in the Zed repository or be external to that and then just be incorporated by Zed into itself during its build.
following up from the previous comment, anyone already working on a zed-codex-acp? might have some time to help this weekend
@cs50victor https://github.com/openai/codex/pull/1707#issuecomment-3243673530
@cs50victor #1707 (comment)
Since merging an ACP implementation into this repo isn't feasible at the moment, do you have any plans to make an independent project from your PR?
probably when I get some time
probably when I get some time
nice. have sometime this weekend to help out if it matches your availability
Exciting!
bump