# letta-code · 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: [letta-code](https://ai-agents-review.com/runtime/letta-code.md)
- Column: [Durable execution](https://ai-agents-review.com/column/durable-execution.md) (Product integration)
- Mark: 2 d
- Default deployment: 2
- Best supported configuration: 2
- Page: https://ai-agents-review.com/cell/letta-code/durable-execution

## Rationale

Cloud background runs and busy handling are server-side [D], so the evidence cap is 2. Local mode loses runs on a crash

## 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

API mode: sends run as server-side `background` runs [D]; on "busy" the client re-attaches to the active stream or polls (5 min); 3 LLM retries. Local mode: runs held in memory; concurrent run rejected; interrupted tool calls settled as incomplete; no resume after a crash. [I54][I55][I56][I57][I58][I59][I60]

## Evidence cited by the mark

- [I54] letta-code — https://github.com/letta-ai/letta-code/blob/52a3bb3bc1999a2fd0f06b1dc2e4b0d94a925c21/src/agent/message.ts#L307 — `background: opts.background ?? true` (server-side semantics) — [S] client / [D] server
- [I55] letta-code — https://github.com/letta-ai/letta-code/blob/52a3bb3bc1999a2fd0f06b1dc2e4b0d94a925c21/src/websocket/listener/send.ts#L228-L264 — on busy, re-attach to active run stream (`starting_after: 0`) — [S]
- [I56] letta-code — https://github.com/letta-ai/letta-code/blob/52a3bb3bc1999a2fd0f06b1dc2e4b0d94a925c21/src/agent/approval-recovery.ts#L25-L26 — busy wait 5 min, poll 5 s — [S]

## Evidence also cited by the review finding

- [I57] letta-code — https://github.com/letta-ai/letta-code/blob/52a3bb3bc1999a2fd0f06b1dc2e4b0d94a925c21/src/headless.ts#L219 — `LLM_API_ERROR_MAX_RETRIES = 3` — [S]
- [I58] letta-code — https://github.com/letta-ai/letta-code/blob/52a3bb3bc1999a2fd0f06b1dc2e4b0d94a925c21/src/backend/local/local-backend.ts#L137 — `LocalBackend extends HeadlessBackend` — [S]
- [I59] letta-code — https://github.com/letta-ai/letta-code/blob/52a3bb3bc1999a2fd0f06b1dc2e4b0d94a925c21/src/backend/dev/fake-headless-backend.ts#L198-L205 — runs and active-run index held in in-memory `Map`s — [S]
- [I60] letta-code — https://github.com/letta-ai/letta-code/blob/52a3bb3bc1999a2fd0f06b1dc2e4b0d94a925c21/src/backend/dev/fake-headless-backend.ts#L511-L528 — local mode rejects a second active run; settles interrupted tool calls as `TURN_DID_NOT_COMPLETE` — [S]

## Grading record

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