Zed Integrates OpenAI Codex via ACP for In-IDE Coding

Zed adds OpenAI Codex via the Agent Client Protocol, enabling Codex in-editor while keeping billing and data with OpenAI. The codex-acp adapter is open-sourced for reuse and comparison of agent behaviors.

zed cover

TL;DR

  • Zed supports OpenAI’s Codex via ACP; Codex selectable from the New Thread menu, billing/legal remain between users and OpenAI, and prompts/code sent via Codex–ACP do not pass through Zed’s servers; codex-acp adapter open-sourced: https://github.com/zed-industries/codex-acp (see https://openai.com/codex/ and https://agentclientprotocol.com/)
  • Codex agent runs terminal commands in its own process and streams raw output bytes to the client, differing from previous adapters that had the client execute requested commands locally
  • PTY vs non-PTY trade-offs: PTY enables interactive, colorized terminals and typing in the Agent Panel but can deadlock on commands that spawn editors; non-PTY reduces interactivity and color fidelity but lowers stuck-agent cases
  • ACP agent behaviors vary (model switching mid-conversation vs single-model, conversation persistence vs stateless), affecting long-running flows and in-editor agent orchestration
  • ACP adoption growing: Zed already supports Claude Code and Gemini CLI; other editors/IDEs adopting ACP (Neovim, Emacs, JetBrains); focus shifting to community collaboration and reusing open-sourced adapters

Zed adds Codex via ACP

Zed now supports OpenAI's Codex via the Agent Client Protocol (ACP), enabling Codex to be selected from the New Thread menu alongside other agents. This integration focuses on preserving the in-IDE workflow: billing and legal arrangements remain directly between the user and OpenAI, and prompts and code sent via the Codex–ACP path do not pass through Zed's servers. The team has also open-sourced the codex-acp adapter for reuse outside Zed.

Relevant links:

Learning from different agents

ACP aims to accommodate a wide range of agent behaviors, but implementation differences affect the user experience. Some agents permit model switching mid-conversation; others require sticking with a single model. Some maintain conversation persistence and history; others do not. These distinctions matter for long-running flows and agent orchestration inside editors.

A concrete example from the Codex adapter: the Codex agent runs terminal commands in its own process and streams raw output bytes to the client, whereas previous adapters had the client execute requested commands locally. That architectural choice leads to different terminal handling and UX trade-offs.

The difference is particularly visible when comparing PTY and non-PTY modes. When a terminal runs in pseudoterminal (PTY) mode (see https://en.wikipedia.org/wiki/Pseudoterminal), interactive processes behave as if attached to a real terminal: colorized output and the ability to type into the process inside the Agent Panel. That interactivity can be useful, but it also introduces potential deadlocks—for example, when a command such as git rebase --continue spawns an editor and waits for input, an agent-driven process can stall if the agent awaits the process to finish while the process waits for human interaction.

Running terminals in non-PTY mode reduces interactivity and color fidelity, but it also reduces the number of situations where agents become stuck. With ACP now supporting agents that both enable and disable PTY, those differences can be compared directly to inform recommendations for future integrations.

What’s next for ACP integrations?

Zed already supports other ACP integrations including Claude Code and Gemini CLI, and has documented broader progress in ACP adoption (ACP progress report). The protocol has also been adopted by other editors and IDEs, including Neovim, Emacs, and the JetBrains family of IDEs (JetBrains announcement).

With ACP gaining independent adoption, the focus will shift toward collaborating with the community on the protocol's future rather than building every adapter in-house. The newly open-sourced adapters and growing cross-editor support are intended to make it easier for the community to build new ACP integrations.

Original source: https://zed.dev/blog/codex-is-live-in-zed

Continue the conversation on Slack

Did this article spark your interest? Join our community of experts and enthusiasts to dive deeper, ask questions, and share your ideas.

Join our community