← Otto Developer Guideotto-agents

User guide: Ask and Agents

components/otto-agents/ is Otto’s agent service. It runs coding agents as child processes that speak the Agent Client Protocol (ACP) on stdio, and serves their sessions to every client over the Agent Host Protocol (AHP), so the launcher’s Ask, the side canvas and Studio share one synchronised view of each session. It is in the app layer of architecture.toml: nothing links it, and clients reach it over the socket through otto-agents-client. It runs as one long-lived process, otto-agents serve, usually from the otto-agents.service systemd user unit. The same binary also carries terminal commands, an ACP facade and the chat bridge.

otto-agents serves AHP clients on a Unix socket and runs one ACP agent per session

How the service works in depth (the two protocols, the launcher as a client, where permission requests and agents’ questions go, skills, configuration) is on Agents. This page is the map of the crate.

Modules

ModuleWhat it does
serverThe listener: a Unix socket (or TCP for development), WebSocket framing with one JSON-RPC message per text frame, one task per connection
rpcJSON-RPC framing and error shapes
hostThe authoritative state: sessions, chats, subscriptions and open questions. Every change goes through one lock, is reduced with ahp::reducers and stamped with the next serverSeq
agentThe Backend trait the host drives through a command and an event channel, and the echo backend for tests and serve --echo
acpThe real backend: one ACP agent per session, as a child process on stdio
config[[agents]] and [bridge] from /etc/otto/agents.toml, then $XDG_CONFIG_HOME/otto/agents.toml
storeOne JSON file per session in $XDG_STATE_HOME/otto-agents/sessions/, so sessions outlive a restart
dialogPermission and question prompts, escalated to otto-islands over org.otto.Dialog1 when no client answers
elicitationACP form elicitations turned into AHP input requests
attachedWhat a session’s prompts attached, and the reads of those files that need no second permission
imagesPictures agents send, written to $XDG_CACHE_HOME/otto/agents/images so they travel as file:// URIs
i18nThe service’s own dialog sentences, from the shared Fluent catalogues
skills, vendorsOtto’s plugins and skills, and the plugin’s agent written in each harness’s own dialect, for plugins install
facadeotto-agents acp: the service presented as one ACP agent on stdin and stdout
cliThe terminal commands and bridge
client, uri, xdgThin re-exports of otto-agents-client and otto-foundations

Commands

main.rs defines the subcommands. serve (the default) runs the service; the rest are clients of a running one, reached at OTTO_AGENTS_URL or the default socket:

CommandWhat it does
serve [--echo] [--listen ADDR]Run the service; --echo uses the built-in echo agent
sessions, show [--follow]List sessions, print a transcript
new, enterStart or take up a session in the agent’s own terminal interface. enter sends releaseSession and then replaces itself with the agent’s command
forgetRemove stored sessions
doctorCheck what stops Ask working, such as a missing dialog renderer
acpThe ACP facade, for chat bridges and editors
bridgeReplace itself with the command [bridge] in agents.toml names
plugins installLink the desktop’s skills into ~/.agents/skills and write the plugin’s agent for each harness

How it runs

Dependencies

Going deeper