codex icon indicating copy to clipboard operation
codex copied to clipboard

Zed integration

Open agu-z opened this issue 6 months ago • 34 comments

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.

agu-z avatar Jul 28 '25 15:07 agu-z

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

github-actions[bot] avatar Jul 28 '25 15:07 github-actions[bot]

I have read the CLA Document and I hereby sign the CLA

agu-z avatar Jul 28 '25 15:07 agu-z

I have read the CLA Document and I hereby sign the CLA

benbrandt avatar Jul 28 '25 15:07 benbrandt

bump on this one, would be super nice as a zed user!

Carcraftz avatar Aug 24 '25 23:08 Carcraftz

this would be really cool to have! and would solve most of my workflow issues!

lolwierd avatar Aug 27 '25 10:08 lolwierd

I know no maintainers like bumping, nonetheless, here's a bump.

hellowodl avatar Aug 28 '25 14:08 hellowodl

shameless bump :) really cant wait for this

korallis avatar Aug 29 '25 09:08 korallis

Getting onto a paid plan once this lands so yeah, bump.

pzurek avatar Aug 29 '25 20:08 pzurek

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)

trieloff avatar Aug 30 '25 14:08 trieloff

This would be really nice. Not only would Zed users benefit from this but also Neovim users via the CodeCompanion plugin ❤️

skriems avatar Sep 01 '25 06:09 skriems

@agu-z Any chance you will have some time to revisit this PR ?

maver1ck avatar Sep 01 '25 20:09 maver1ck

I have a wip version at https://github.com/openai/codex/compare/main...maan2003:codex:ma/ovkvm

maan2003 avatar Sep 02 '25 03:09 maan2003

Bump :)

pidgeon777 avatar Sep 02 '25 15:09 pidgeon777

  • [x] Gemini
  • [x] Claude Code
  • [ ] Codex

https://zed.dev/blog/bring-your-own-agent-to-zed https://zed.dev/blog/claude-code-via-acp

DaleLJefferson avatar Sep 03 '25 16:09 DaleLJefferson

Bump

futurisold avatar Sep 03 '25 16:09 futurisold

we don't need bumps every 15 minutes, just a leave a :+1:

maan2003 avatar Sep 03 '25 16:09 maan2003

Bump

SunilDhaker avatar Sep 04 '25 06:09 SunilDhaker

has anyone been able to fix the conflicts? as this is prety much done.

korallis avatar Sep 04 '25 17:09 korallis

@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?

hellowodl avatar Sep 04 '25 19:09 hellowodl

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.

bolinfest avatar Sep 04 '25 20:09 bolinfest

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.

bolinfest avatar Sep 04 '25 20:09 bolinfest

So ahat does this mean in english for us people that are desperatlt waitimg for codex integration

korallis avatar Sep 04 '25 21:09 korallis

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.

pyrmont avatar Sep 04 '25 21:09 pyrmont

following up from the previous comment, anyone already working on a zed-codex-acp? might have some time to help this weekend

cs50victor avatar Sep 05 '25 08:09 cs50victor

@cs50victor https://github.com/openai/codex/pull/1707#issuecomment-3243673530

maan2003 avatar Sep 05 '25 08:09 maan2003

@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?

cs50victor avatar Sep 05 '25 09:09 cs50victor

probably when I get some time

maan2003 avatar Sep 05 '25 09:09 maan2003

probably when I get some time

nice. have sometime this weekend to help out if it matches your availability

cs50victor avatar Sep 05 '25 09:09 cs50victor

Exciting!

MuenYu avatar Sep 05 '25 11:09 MuenYu

bump

Dev-cmyser avatar Sep 05 '25 17:09 Dev-cmyser