Skip to content

An open-source, faster Devin alternative

TypeScript

docs(agent-sessions): overview architecture diagram; reconcile durability wording

Igor Zalutskiaed940715d5b
diff --git a/docs/agent-sessions/api-reference.mdx b/docs/agent-sessions/api-reference.mdx
index 6ca64d64..85d172fa 100644
--- a/docs/agent-sessions/api-reference.mdx
+++ b/docs/agent-sessions/api-reference.mdx
@@ -29,7 +29,7 @@ Session = { id, status, head, input_cursor,
limits: { tokens?, turn_seconds?, turns? }, key?, created_at }
```
-`yield_reason` (`completed | needs_input | error | budget_exceeded | deadline_exceeded | max_turns | canceled`) is the machine-readable "why the turn ended" — `needs_input` means the agent asked a question; answer it by [steering](#steer).
+`yield_reason` (`completed | needs_input | error | budget_exceeded | deadline_exceeded | max_turns | canceled`; `requires_action` is reserved, not emitted yet) is the machine-readable "why the turn ended" — `needs_input` means the agent asked a question; answer it by [steering](#steer).
## Events
diff --git a/docs/agent-sessions/durability.mdx b/docs/agent-sessions/durability.mdx
index 211a90bd..147591c8 100644
--- a/docs/agent-sessions/durability.mdx
+++ b/docs/agent-sessions/durability.mdx
@@ -7,10 +7,11 @@ A Durable Agent Session is **never lost and always resumable** — that's the pr
- The **event log is durable forever** (the record of everything the agent did).
- **Disconnect** → reconnect from any cursor, nothing missed.
-- The runtime **crashes or hangs** → we **restart it automatically** and it continues from where it was.
-- The session **idles** → it hibernates (≈ free) and **survives even if its sandbox is reclaimed**.
+- The runtime **crashes** → we **restart it automatically** and it picks up from where it was.
+- The runtime **hangs** → a turn deadline bounds it; the turn ends and you steer to continue.
+- The session **idles** → it hibernates (≈ free) and the session **survives even if its sandbox is reclaimed**.
-The only thing not yet covered: resuming **mid-turn** across a sandbox loss (that one turn re-runs) — see [Limits](#limits).
+Narrow edges, all on the roadmap (see [Limits](#limits)): a sandbox lost **mid-turn** re-runs that turn; a hung turn ends at its deadline rather than auto-continuing; **uncommitted files** don't survive sandbox loss (commit/push to keep them).
## The event log is the source of truth
@@ -39,9 +40,9 @@ When a session has nothing to do it goes **idle** and its sandbox **hibernates**
You don't restart anything — the platform does. The runtime keeps its working state (the agent's session journal) on the sandbox, and OpenComputer recovers it for you:
-- **Runtime crashes** (process dies, sandbox fine) → we start it again **in the same sandbox**; it continues from its on-box journal, not from scratch.
-- **Runtime hangs** → it's detected (a turn has a max duration) and **restarted in place**.
-- **Sandbox reclaimed while idle** → we recreate it and **restore the last checkpoint**, resuming from the last completed turn.
+- **Runtime crashes** (process dies, sandbox fine) → we start it again **in the same sandbox**; it continues from its on-box journal, not from scratch (work since the last journaled step may repeat).
+- **Runtime hangs** → bounded by a **turn deadline**; the turn ends with `deadline_exceeded` and you steer to continue. (Faster heartbeat-based restart is on the roadmap.)
+- **Sandbox reclaimed while idle** → we recreate it and **restore the last checkpoint**, resuming the conversation from the last completed turn. (The brain state is restored; commit/push to keep file changes — see below.)
## Limits
@@ -50,9 +51,10 @@ What's guaranteed today, and what isn't:
| Failure | What happens |
| --- | --- |
| Client disconnects | Reconnect from your cursor; nothing lost. |
-| Session idles | Sandbox hibernates; resumes on the next message (state checkpointed off-box). |
-| Runtime crashes / hangs | **Auto-restarted; continues from the on-box journal** — in-flight work since the last logged event may repeat (make side effects idempotent). |
-| Sandbox lost **while idle** | Recreated and **restored from the last checkpoint**; resumes from the last completed turn. |
+| Session idles | Sandbox hibernates; resumes intact on the next message. |
+| Runtime **crashes** | **Auto-restarted in the same sandbox; continues from the on-box journal** — work since the last journaled step may repeat (make side effects idempotent). |
+| Runtime **hangs** | Bounded by the turn deadline; the turn ends `deadline_exceeded` — steer to continue. |
+| Sandbox lost **while idle** | Recreated and **restored from the last checkpoint**; conversation resumes from the last completed turn. **Uncommitted hands-sandbox files are not restored** — commit/push to keep them. |
| Sandbox lost **mid-turn** | That one turn **re-runs** from the log. Only **logged / committed / delivered** work product is guaranteed. |
<Warning>
diff --git a/docs/agent-sessions/overview.mdx b/docs/agent-sessions/overview.mdx
index 9af06391..770afc49 100644
--- a/docs/agent-sessions/overview.mdx
+++ b/docs/agent-sessions/overview.mdx
@@ -7,12 +7,41 @@ Give an agent a prompt and a task; OpenComputer runs it on a **fully managed run
**You never babysit the runtime.** A session is *durable*: we keep your agent running, and recover it for you.
-- **Crashes or hangs?** We **restart it automatically** — it continues from where it was, mid-task, not from scratch.
-- **Idle for hours or days?** It hibernates (≈ free) and **survives even if the underlying sandbox is reclaimed** — its state is checkpointed off-box, so it wakes back up intact.
+- **Crashes?** We **restart it automatically** — it picks up from where it was, not from scratch.
+- **Hangs?** A turn deadline bounds it; the turn ends and you steer to continue.
+- **Idle for hours or days?** It hibernates (≈ free) and resumes intact — and even if the underlying sandbox is reclaimed, its state is checkpointed off-box so the session comes back.
- **Disconnect?** Reconnect from any cursor — nothing missed.
That managed, self-healing runtime — not just a chat API over a model — is the point.
+## How it fits together
+
+```mermaid
+flowchart LR
+ App["Your app / browser"]
+
+ subgraph S["Durable Agent Session — managed by OpenComputer"]
+ direction TB
+ Brain["Runtime · brain<br/>(agent loop, auto-restarted)"]
+ Log[("Event log · durable")]
+ Hands["Sandbox · hands<br/>(files + commands)"]
+ Brain <-->|read / append| Log
+ Brain -->|remote tools| Hands
+ end
+
+ Sec["Your Anthropic key<br/>(secret store)"]
+ Model["Anthropic"]
+ Hook["Your webhook"]
+
+ App -->|start · steer| Log
+ Log -->|stream · SSE| App
+ Brain -->|model calls| Model
+ Sec -. "injected on egress — never in a sandbox" .-> Model
+ Log -->|Standard Webhooks| Hook
+```
+
+The **event log** is the durable spine: you start and steer against it, stream from it, and it drives the runtime. The **brain** (agent loop) is isolated from the **hands** sandbox (where commands and file edits run), and your key lives in the secret store — never in a sandbox.
+
<Steps>
<Step title="Define an agent (with your key)">
A reusable `{ name, model, prompt, runtime }` — `POST /v3/agents`. Pass your Anthropic `key` inline (sessions run on your own key); it's stored as a [credential](/agent-sessions/authentication#model-credentials). ([Agents](/agent-sessions/agents))
@@ -33,8 +62,8 @@ The hard parts, handled:
<CardGroup cols={2}>
<Card title="Self-healing, managed runtime" icon="heart-pulse">
- - Crash or hang → **auto-restart**, continues mid-task
- - Idle → hibernate (≈ free); **survives sandbox loss**
+ - Crash → **auto-restart**, picks up where it was
+ - Idle → hibernate (≈ free); **session survives sandbox loss**
- You never restart anything — [details](/agent-sessions/durability)
</Card>
<Card title="Brain / hands isolation" icon="shield-halved">
diff --git a/docs/agent-sessions/quickstart.mdx b/docs/agent-sessions/quickstart.mdx
index 8756bb86..8e77e5b8 100644
--- a/docs/agent-sessions/quickstart.mdx
+++ b/docs/agent-sessions/quickstart.mdx
@@ -39,7 +39,7 @@ curl https://api.opencomputer.dev/v3/sessions \
```jsonc
{
- "session": { "id": "sess_abc", "status": "queued", "head": 0, "input_cursor": 0 },
+ "session": { "id": "sess_abc", "status": "queued", "head": 1, "input_cursor": 0 },
"client_token": "ct_…" // session-scoped; safe to hand to a browser (read + steer)
}
```
diff --git a/docs/agent-sessions/runtimes.mdx b/docs/agent-sessions/runtimes.mdx
index a1b7204a..97b42696 100644
--- a/docs/agent-sessions/runtimes.mdx
+++ b/docs/agent-sessions/runtimes.mdx
@@ -3,7 +3,7 @@ title: "Runtimes"
description: "The engine that runs your agent — claude today, more soon"
---
-A **runtime** is the stateless engine that executes the agent loop. You pick one per agent via `runtime`; it defaults to `claude`.
+A **runtime** is the engine that executes the agent loop. You pick one per agent via `runtime`; it defaults to `claude`. The runtime **image** is stateless and interchangeable; the **running instance** keeps its session state on the sandbox, and OpenComputer manages and recovers it for you (see [durability](/agent-sessions/durability)).
## `claude` — available today
@@ -33,4 +33,4 @@ A runtime is a container image implementing the **runtime contract**. On wake it
4. Performs all side effects through the **remote sandbox tools** (no local disk or network).
5. Calls the model, and **exits 0 when it has nothing left to do** (yield, don't block).
-It holds no durable state — the session is the durable record. You'll register it with `oc runtime push <image>` and select it with `runtime: "<name>"`. This is the extensibility seam: any agent harness becomes a runtime.
+The **image** carries no durable state — the durable record is the session (event log) plus the runtime's session journal, which the platform checkpoints and restores for the instance ([durability](/agent-sessions/durability)). You'll register it with `oc runtime push <image>` and select it with `runtime: "<name>"`. This is the extensibility seam: any agent harness becomes a runtime.
diff --git a/docs/agent-sessions/sessions.mdx b/docs/agent-sessions/sessions.mdx
index dbd90578..986da9fa 100644
--- a/docs/agent-sessions/sessions.mdx
+++ b/docs/agent-sessions/sessions.mdx
@@ -12,7 +12,7 @@ A **session** is the durable unit of an [agent](/agent-sessions/agents) at work:
3. With nothing left to do, the session goes **idle** and the sandbox **hibernates** (see [durability](/agent-sessions/durability)).
4. A [steer](/agent-sessions/messaging) message wakes it; it resumes with its prior context. Repeat.
-<Note>The runtime is **managed and self-healing**: if it crashes or hangs we restart it and it continues from its on-box state, and an idle session survives even if its sandbox is reclaimed. In-flight work since the last logged event may repeat, so make side effects idempotent. Details: [durability](/agent-sessions/durability).</Note>
+<Note>The runtime is **managed and self-healing**: if it **crashes** we restart it and it continues from its on-box state; if it **hangs**, a turn deadline ends the turn and you steer to continue; an idle session survives even if its sandbox is reclaimed. In-flight work since the last logged event may repeat, so make side effects idempotent. Details: [durability](/agent-sessions/durability).</Note>
## Lifecycle