A small server process authenticates, keeps the catalog and routes. Supervised worker processes, one per profile, run the agents. Every session is its own SQLite store, open only while something needs it.
01Processes
A server that cannot be taken down by agent work
Fig. 3.1The server runs no model calls, tools, MCP servers or extensions. Everything that can misbehave lives behind a worker’s hatched edge.
Not one processAn extension, an MCP server or a runaway tool can crash its worker. It cannot crash the listener, the catalog or another profile’s sessions.
Not a process per sessionA Node process costs roughly 60 MB before it does anything. A worker holds the Harnesses of many sessions and opens their stores only when they are used.
A trust domain eachA worker is one profile’s trust domain. Isolation between mutually untrusted work means another uid, a container or a remote execution environment.
02Routing
From a socket to a session
Fig. 3.2The catalog says which profile, and so which worker, owns a session; the worker owns its store.
The catalog, state/catalog.sqlite, belongs to the server. It holds each session’s id, name, profile, title, cwd, nonsecret variables, creation and activity times, read and archive marks, default chat and drafts, and whether it holds live work. It never holds conversation content: that is only ever in the session’s own store, which only its profile’s worker opens.
03Stores
Open while needed, closed otherwise
Fig. 3.3Each store is a file at state/sessions/<id>/session.sqlite. Back one up, or move it to another host, by copying it.
A worker reports whether each open store holds live work — a pending, running, waiting or completing task, or a queued or placed submission — and the catalog records it. The report of new work is made before the commit that starts it, and the report that it ended after the commit that finishes it, so a crash can never leave started work marked idle. At startup that mark is the whole recovery plan: exactly the marked sessions are reopened and resumed, and nothing else is touched.
04Startup
Ready means resumed
Fig. 3.4The listener opens only after every worker is up and its live sessions are moving again.
05Crashes
A crashed worker restarts; nobody else notices
Fig. 3.5Backoff keeps a crash loop from becoming a restart storm; a stable worker earns a fast restart again.
Process supervision above the daemon is the job of systemd, launchd or supervisord, and of the semantic watchdog, which restarts the daemon only when its listener stops answering.
06Multiplexing
Cost follows what is open, not what exists
Fig. 3.6A profile’s concurrency caps its turns at once (default 16), so one application’s fleet cannot starve your personal sessions.
A store stays open for five minutes after its last use and its last live work, then closes. A session that nobody has touched for a week costs one closed file and one catalog row.
07Bounds
Every queue has a size
Where
Bound
Value
listener
connections
1,024
listener
header and request timeouts
30 s · 60 s
AHP
connections · frame size
256 · 4 MiB
AHP
unsent backlog before a client is dropped to reconnect
16 MiB
AHP
requests in flight per connection
64
AHP
root actions kept for reconnect
4,096
AHP
chats streaming live · turns starting per chat
256 · 64
AHP
turns in a snapshot or page, unless asked for fewer
50
Chord
calls in flight · subscriptions per connection
64 · 64
catalog
page size, default and most
100 · 1,000
worker
calls in flight · watches · terminals
4,096 · 1,024 · 64
worker
prompt resends after it dies
3
worker
restart delay, first and most · stable after
100 ms · 5 s · 10 s
store
idle time before it closes
5 min
startup
sessions resumed at once per worker
4
profile
turns at once (concurrency)
16
MCP
wait for servers on open · tools offered before tool_search