Skip to content

Agent Client Protocol (ACP)

ox acp exposes oxide-code as an Agent Client Protocol server over newline-delimited JSON-RPC 2.0 on stdin and stdout. The server lives in the crates/ox-acp frontend crate and depends only on ox-core and ox-jsonrpc.

Terminal window
ox acp --model gemini-4-neon
ox acp --config ~/.config/ox/config.toml -C /path/to/repo

ox acp accepts the Provider and Workspace flags.

Method Direction Description
initialize Request Returns protocolVersion, serverInfo, and capabilities
session/new Request Creates a session with an optional cwd and returns { sessionId }
session/prompt Request Runs a prompt turn, streams session/update, and returns stopReason
session/cancel Request Cancels an active prompt turn or acknowledges an idle session
shutdown Request Acknowledges shutdown and exits the stdio server loop
session/update Notify Streams agent_message_chunk, agent_thought_chunk, and tool lifecycle

During session/prompt, ox acp emits session/update notifications:

  • agent_message_chunk: incremental assistant text (content.type = "text").
  • agent_thought_chunk: incremental reasoning text (content.type = "text").
  • tool_call: tool invocation start with toolCallId, title, status = "in_progress", and rawInput.
  • tool_call_update: tool completion with toolCallId, title, status = "completed" or "failed", and rawOutput.

session/prompt resolves with { "stopReason": "..." }:

  • end_turn: model finished the turn normally.
  • max_tokens: model hit the configured output token limit.
  • max_turn_requests: agent reached --max-turns.
  • cancelled: cancelled by session/cancel or client EOF.