Skip to content

ACP Protocol

源码版本v2026.7.20

Responsibility

ACP (Agent Client Protocol) is a standard protocol for editors/IDEs to talk to an agent. acp_adapter/ exposes Hermes as an ACP server so that ACP-capable clients (Zed, VS Code extensions, etc.) can directly drive Hermes: manage sessions, read/write resources (files/images), approve edits, trace provenance, and isolate tools by permission. This lets Hermes extend beyond messaging platforms and embed into development workflows.

Key Files

Data Flow

  1. An ACP client (editor) discovers and launches the Hermes ACP server via acp_registry/agent.json (acp_adapter/__main__.py).
  2. The client opens a session → SessionManager:175 creates a SessionState, aligns cwd (acp_adapter/session.py:29), and expands toolsets (acp_adapter/session.py:129).
  3. The client sends a message/resource → resource conversion:201 turns the ACP resource (file/image, subject to the acp_adapter/server.py:96 size limit) into OpenAI content parts, fed to run_conversation:588.
  4. When the agent wants to modify a file, the tool call becomes an EditProposal via build_edit_proposal:178, popped to the user for confirmation via the approval requester (acp_adapter/edit_approval.py:51).
  5. Tool execution is gated by acp_adapter/permissions.py permissions; each operation records provenance via acp_adapter/provenance.py:22.
  6. Streaming output and events (acp_adapter/events.py) are returned to the client.

Summary

ACP lets Hermes embed into editor workflows: session management, resource read/write, edit approval, permission isolation, provenance tracing. The core is server.py (protocol adaptation) + session.py (sessions) + edit_approval.py (human-approved edits). It complements the gateway layer — the gateway connects to messaging platforms, ACP connects to IDEs.

Unofficial community learning site. Content based on the MIT-licensed NousResearch/hermes-agent source.