Voicebox documentation

Agent Client Protocol (ACP) Adapters

Voicebox integrates external coding agents—such as Pi (lib/pi-acp.mjs) and Claude Code (lib/claude-acp.mjs)—using the Agent Client Protocol (ACP v1) over stdio JSON-RPC (lib/acp-client.mjs).


1. Activating a Coding Agent Harness

You can activate a host coding agent harness in either of two ways:

  1. In the Browser UI (Recommended):
    • Click Harnesses in the top bar, inspect the detected coding agents on your machine, and click Use Pi or Use Claude (PUT /api/harnesses/active). The selection is saved in .harness-settings.json and activates the corresponding ACP executor immediately without restarting the server.
  2. Via Environment Variable at Startup:
    VOICEBOX_HARNESS=pi npm start
    # or
    VOICEBOX_HARNESS=claude npm start
    

To verify installed harness binaries and adapter readiness from the terminal:

npm run doctor

When no harness is active, calling delegate_task returns executor-unavailable.


2. ACP Client & Executor Architecture

Shared ACP Client (lib/acp-client.mjs)

createAcpClient manages the JSON-RPC stdio lifecycle for both Pi and Claude Code:

Pi ACP Adapter (lib/pi-acp.mjs)

Claude Code ACP Adapter (lib/claude-acp.mjs)


3. Configured Agent Options (core/harness-config.ts)

When delegate_task targets a configured agent entry (core/harness-config.ts, lib/harness-config.mjs), the adapter applies and validates its settings before running the prompt:

  1. Model Selection: Forwarded via session/set_config_option (configId: "model"). Unsupported models fail pre-flight with model-unsupported.
  2. Thinking / Reasoning Effort: When model.thinking is specified, forwarded via session/set_config_option (configId: "thought_level"). Unsupported levels fail with thinking-level-unsupported.
  3. System Persona (agentConfig.prompt): Prepended to the task prompt as system framing.
  4. Tool Reach Enforcement (agentConfig.reach.tools): Any tool request outside the agent’s declared reach list is refused with tool-not-in-agent-reach before consulting host policy.
  5. Pre-Flight Validation: Mismatched adapter versions, unsupported transports, or unconfigured harnesses fail closed with adapter-not-configured, adapter-version-unsupported, unsupported-runtime-capability, or unsupported-model-options.

4. Live Progress, Console Output & Secret Redaction

During ACP and Claude Code task execution, intermediate protocol events and console logs are surfaced live in the UI:


5. Browser Placement Boundary

Stdio ACP adapters (lib/pi-acp.mjs, lib/claude-acp.mjs) spawn local OS subprocesses and therefore run on machine and remote placements (lib/tasks.mjs). Zero-server browser environments (tests/acp-browser.test.mjs) use createBrowserTaskHost() in lib/task-placement.mjs (see 16-zero-server-delegation.md).

Verification Suites

VOICEBOX_ACP_ADAPTER="$PI_ACP_INSTALL_DIR" VOICEBOX_ACP_PI="$PI_BINARY" \
  node --test tests/acp-client.test.mjs tests/pi-acp.test.mjs tests/acp-browser.test.mjs tests/tasks.test.mjs tests/configured-harness.test.mjs