vtcode-acp
July 1, 2026 · View on GitHub
Root AGENTS.md | Agent Client Protocol (Zed integration). Canonical ACP entrypoint.
Modules
capabilities/ protocol negotiation | client/ legacy client (deprecated) | client_v2/ current ACP client | discovery/ agent registry | session/ session lifecycle | transport/ StdioTransport | jsonrpc/ JSON-RPC types | tooling/ tool adapters | zed/ Zed-specific adapter | workspace/ workspace helpers | permissions/ permission flow | reports/ reporting | error/ AcpError
zed/agent/handlers.rs is the canonical SACP handler wiring; zed/connection.rs wraps the SACP ConnectionTo<Client> handle.
Rules
AcpClientV2is the current API.AcpClientis deprecated (legacy since 0.60.x).StandardAcpAdapter/ZedAcpAdapterinzed/bridge protocol to Zed.register_acp_connection()is a globalOnceLock<Arc<ConnectionHandle>>— call once from the host protocol after the SACPconnect_withclosure receives thecx.acpmodule invtcode-coreis the compatibility facade; canonical code lives here.- ACP 1.0.1 uses SACP builder + handlers, not the old
impl acp::Agenttrait.handlers.rsregisters SACP request/notification handlers aroundZedAgent. ZedAgentisSend + Sync(Arc<Mutex<_>>+AtomicBool) so it can be moved into SACPcx.spawntasks.- Tool execution RPCs (
fs/read_text_file,terminal/create,session/request_permission) must be called from inside acx.spawn(...)task — invoking them directly from an SACP request handler deadlocks the dispatch loop.
Gotchas
PROTOCOL_VERSION+SUPPORTED_VERSIONScontrol negotiation — update both when protocol changes.messages.rstypes are deprecated — usejsonrpc/module instead.ConnectionHandlewrapsagent_client_protocol::ConnectionTo<Client>. Theblock_task()future returned bycx.send_request(...).block_task()is only safe in acx.spawntask; calling it from a request handler deadlocks.- The
acpmodule re-exportsagent_client_protocol::schema::v1::*plusProtocolVersionfromschema::*.ClientandAgent(role structs) are at the crate root.