Harness Notes

ACP

Updated 2026-11-25,

On this page

The Agent Client Protocol (ACP) lets an editor such as Zed or a JetBrains IDE run a coding agent in its own panel. How to connect each harness, what carries over from its terminal app, and how much of the work the editor sees and controls.

Getting connected

QuestionOpenCodechecked at 2.0.29
Run it as an ACP agent

Run opencode acp; ACP is built into OpenCode, no adapter package is needed. It speaks newline-delimited JSON-RPC (protocol version 1) on stdin/stdout, starts its own private OpenCode server and exits when stdin closes.

Add --print-logs before acp (opencode --print-logs acp) to send logs to stderr when debugging; stdout carries only ACP messages.

1.x (opencode-ai) uses the same opencode acp command.

Add it to Zed, JetBrains or another editor

OpenCode is in the ACP registry (id opencode), so Zed can install it via zed: acp registry. For a custom binary, add "agent_servers": {"OpenCode": {"command": "opencode", "args": ["acp"]}} to Zed's settings.json or JetBrains' acp.json; Avante.nvim and CodeCompanion.nvim are also documented.

The registry entry downloads the 1.x release binary (currently v1.19.0), not the 2.x @opencode/cli. To use 2.x in an editor, point command at your 2.x opencode binary.

If a GUI editor cannot find opencode, use the absolute path from which opencode.

Signing in

OpenCode advertises one auth method, opencode-login, and uses the provider credentials already stored by opencode auth login. If the client sets clientCapabilities.auth.terminal, the method becomes a terminal auth method with args --login, so the editor runs opencode acp --login in a terminal; a prompt that needs credentials fails with ACP's auth_required error.

authenticate does not collect credentials; it just accepts opencode-login.

Clients that set _meta["terminal-auth"] get the login command (opencode auth login) in the method's _meta. Provider API keys can also come from the environment or OpenCode config as usual.

Sessions and settings

QuestionOpenCodechecked at 2.0.29
Resume, list or fork past sessions

session/list (100 per page, cwd filter, cursor), session/load (replays history), session/resume, session/fork, session/close and session/delete are all supported. Sessions live in OpenCode's normal session store, so sessions started in the terminal app appear in the editor and vice versa.

Load, resume and fork must pass the session's original directory as cwd; a different cwd is rejected.

1.x supports list, load, resume, fork and close but not session/delete or additionalDirectories.

Switch mode or model from the editor

Each session exposes config options model (enabled models as provider/model, optional /variant), effort (model variants, when the model has them) and mode (visible primary agents such as build and plan). Change them with session/set_config_option; session/set_mode also switches the agent.

2.x has no session/set_model; use the model config option. 1.x also implements the unstable session/set_model.

OpenCode sends config_option_update when available models or agents change or another client changes the session's model or agent.

Slash commands and skills

After a session is created or loaded OpenCode sends available_commands_update with the project's custom commands plus the built-in compact, and resends it when commands change. A prompt starting with /name runs that command with the rest of the text as arguments.

Built-in TUI commands such as /undo and /redo are not available over ACP.

Working with the editor

QuestionOpenCodechecked at 2.0.29
Approving tool calls

When OpenCode's permission rules say ask, it sends session/request_permission with three options: once (allow_once), always (allow_always) and reject (reject_once). Your opencode.json permission settings still apply, so allow and deny rules never reach the editor; edit requests include a diff preview when one can be built.

Cancelling a prompt rejects any pending permission requests. Requests from subagent (child) sessions carry _meta["opencode/child-session"].

Edits through the editor's buffers

Not supported

2.x reads and writes files straight to disk with its own tools and never calls fs/read_text_file or fs/write_text_file, so unsaved editor buffers are not seen. Edit diffs show up in permission requests instead.

1.x (opencode-ai) writes an approved edit back through fs/write_text_file after the permission is granted, so the editor sees the change; it still reads from disk.

Commands in the editor's terminal

Not supported

Shell commands run in OpenCode's own shell; the ACP layer never calls terminal/create or other client terminal methods. Command output streams back as tool call content.

MCP servers from the editor

Partly

Editors can pass stdio and HTTP MCP servers in session/new, session/load, session/resume and session/fork; OpenCode adds them to the session directory for the life of the opencode acp process, alongside the MCP servers from its own config. SSE servers are rejected with an invalid params error.

HTTP headers are passed through; OAuth is not used for editor-supplied servers. Editor-supplied servers are visible to other sessions in the same directory within that process.

1.x advertises and accepts SSE MCP servers as well.

What prompts carry and what streams back

Prompts can carry text, images, embedded resources and resource links (file:// and zed:// links are attached as files); audio blocks are ignored. Back come message and thought chunks, tool calls with kinds, locations and output, permission diffs, usage_update and end-of-turn usage, plus compaction and retry status.

OpenCode does not send plan updates, and tool call updates carry text/image output rather than diff content.

Subagent activity is forwarded on the parent session with tool call ids prefixed <childSessionId>:. If the client advertises elicitation.form, OpenCode asks questions with elicitation/create.

Elicitation here is an ACP client/host contract, not proof of downstream MCP elicitation mode support or validation; see docs/research/mcp-elicitation.md.

The other direction

QuestionOpenCodechecked at 2.0.29
Drive other ACP agents

Not supported

OpenCode is only an ACP agent; neither 2.x nor 1.x contains ACP client code to launch or drive other ACP agents. Its subagents are OpenCode's own child sessions.

Notes and sources

OpenCode, 17 sources
  • Answers describe OpenCode 2.x (@opencode/cli). 1.x (opencode-ai) uses the same opencode acp command; differences are called out per question.
  • The ACP registry and Zed's registry install currently ship the 1.x binary.
  • Remote connectivity, provider relay, cloud handoff and execution lifetime are separately audited on 2026-10-19 in registry/remote.json. ACP answers retain the observed versions recorded here; stdio support does not imply network attachment.
Run it as an ACP agent, 3
Add it to Zed, JetBrains or another editor, 3
Signing in, 3
Resume, list or fork past sessions, 3
Switch mode or model from the editor, 3
Slash commands and skills, 3
Approving tool calls, 2
Edits through the editor's buffers, 2
Commands in the editor's terminal, 2
MCP servers from the editor, 4
What prompts carry and what streams back, 4
Drive other ACP agents, 2