Skip to content

An open-source, faster Devin alternative

TypeScript

docs(runtimes): expand the claude runtime — structure + reliability/supervision

Igor Zalutskid8e8a700c672
diff --git a/docs/agent-sessions/runtimes.mdx b/docs/agent-sessions/runtimes.mdx
index 97b42696..d16f2932 100644
--- a/docs/agent-sessions/runtimes.mdx
+++ b/docs/agent-sessions/runtimes.mdx
@@ -16,6 +16,31 @@ curl https://api.opencomputer.dev/v3/agents \
"prompt": "You review code.", "runtime": "claude" }'
```
+### How it's structured
+
+The runtime runs the agent loop in its **own per-session sandbox** (the *brain*). The agent's file and shell tools don't run there — they run in a **separate sandbox** (the *hands*) that the brain drives through remote tools, so the model has no local disk or network of its own: the sandbox is the only surface it can act through. The brain carries the [sealed model key](/agent-sessions/authentication#model-credentials) (egress-allowlisted to the model API, swapped in by a host proxy so the key never enters the VM); the hands sandbox holds no secrets at all.
+
+Each **turn is one bounded run**, invoke-style — it:
+
+1. reads the new input from the [event log](/agent-sessions/events) at the cursor,
+2. drives the Claude Agent SDK loop,
+3. **streams every step back as events** over the authenticated events API,
+4. performs side effects only through the remote [sandbox tools](/agent-sessions/runtime-tools) (`bash` / `read` / `write` / `ls`, plus `say` / `ask`), and
+5. **exits when it has nothing left to do** — it yields rather than busy-waits (waiting on a person, a build, or the clock costs no compute).
+
+Across turns it continues an on-box **journal**; the durable record is the event log *plus* that journal, which the platform checkpoints at each boundary and restores on recovery ([durability](/agent-sessions/durability)).
+
+### Reliability & supervision
+
+A regional **supervisor** owns each running session and keeps the runtime healthy — you never restart anything:
+
+- **One driver at a time.** The supervisor holds a **fenced lease** on the session: exactly one runtime instance may write at a time, and the fence rejects a stale or zombie instance (e.g. a slow machine that returns after it was given up) — no split-brain, no double-writes.
+- **Liveness.** The lease is renewed while a turn runs. If the runtime's machine dies, the lease lapses and the supervisor **re-claims the turn and continues it** from the journal.
+- **Crash / hang / lost machine.** A bad exit restarts the turn in place (bounded attempts, with crash-loop backoff); a hung turn is bounded by a **deadline** and ends `deadline_exceeded`; a lost machine is recreated and **restored from the last checkpoint**. Full matrix in [durability](/agent-sessions/durability#limits).
+- **Failures surface — never an eternal spinner.** If a turn can't even start (the model key can't be resolved, the runtime image can't be fetched), the turn ends with an **`error` event carrying the reason** and the session returns to idle, instead of hanging.
+- **Backstop reconciler.** A periodic sweep re-dispatches work whose wake-up was missed, re-claims turns whose lease expired, and resets sessions left `running` after a crash — so nothing strands silently.
+- **Observable.** Every turn and machine transition — turn start / complete / error, sandbox create / provision / hibernate, lease renew / fence — is recorded, so the platform can show exactly where a session is and why a turn ended the way it did.
+
## Coming soon
<Note>The runtimes below are not yet callable. When one is available, you select it by setting `runtime` to its name — nothing else changes.</Note>