# opencode · Durable execution

> Levels are per column and must not be summed, averaged or ranked. A level states which written criterion the runtime's source meets. It is not a measure of quality or task success. Higher is not always preferable.

Source: "Agent runtime comparison: ten open-source agent runtimes, source review", study of 2026-11-28. Mark notation: `3` is the level in the default deployment; `1→4 [opt: …]` is level 1 by default and level 4 in the named configuration; `s` source-verified, `d` documented or test only. Service dependencies are classes (E embedded, O on demand, R resident service, X external server required), not levels.

- Runtime: [opencode](https://ai-agents-review.com/runtime/opencode.md)
- Column: [Durable execution](https://ai-agents-review.com/column/durable-execution.md) (Product integration)
- Mark: 4 s
- Default deployment: 4
- Best supported configuration: 4
- Page: https://ai-agents-review.com/cell/opencode/durable-execution

## Rationale

Durable inbox outlives disconnect; one execution per session; boot sweep resumes claims, documented as at-least-once

## Rubric criteria for this column

- 0: State in memory only; a restart loses sessions
- 1: Sessions persist, but an in-flight turn is lost on restart **and** concurrent requests on one session are not serialized (dropped or racing)
- 2: Sessions persist and concurrent input is serialized (queue, steer or reject), but an interrupted turn is lost or must be resent by hand
- 3: Level 2, plus an interrupted turn is detected after restart and either closed out with a recorded error **or** resumed
- 4: Level 3, plus turns survive client disconnect **and** automatic resume or replay with an explicit idempotency rule (request ids, replay-safe declarations, at-least-once documented)

## Review finding

Built in: prompts go to a durable inbox drained server-side, so disconnect does not stop a turn. One execution per session; new input steers or queues. Boot sweep resumes orphaned execution claims at least once (up to 10 attempts); tool side effects may repeat. [I102][I103][I104][I105]

## Evidence cited by the mark

- [I102] opencode — https://github.com/anomalyco/opencode/blob/2204311ec6e966db8d67988ab3638ad95a811a46/packages/core/src/session/run-coordinator.ts#L4-L27 — per-key serialized execution; `run` joins active execution — [S]
- [I104] opencode — https://github.com/anomalyco/opencode/blob/2204311ec6e966db8d67988ab3638ad95a811a46/packages/core/src/session/execution/restart.ts#L49-L80 — `DEFAULT_MAX_ATTEMPTS = 10`; "Recovery is at-least-once … not repeated external side effects"; embedders may call it — [S]
- [I105] opencode — https://github.com/anomalyco/opencode/blob/2204311ec6e966db8d67988ab3638ad95a811a46/packages/server/src/process.ts#L276-L283 — managed server runs restart continuity at boot — [S]

## Evidence also cited by the review finding

- [I103] opencode — https://github.com/anomalyco/opencode/blob/2204311ec6e966db8d67988ab3638ad95a811a46/packages/schema/src/session-inbox.ts#L11-L15 — inbox delivery modes steer/queue — [S]

## Grading record

- Grader A (default / best): 4 / 4
- Grader B (default / best): 4 / 4
