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

## Rationale

CLI rejects concurrent prompts; orphaned calls get only synthetic transform-time errors, not recorded. pi-durable resumes or settles failed; unresolved: disconnect

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

Not durable mid-turn: entries appended as finalized; on resume, orphaned tool calls get synthetic "No result provided" errors, not re-run. Second prompt while streaming rejected unless steer/followUp. stdin EOF waits for pending work. No session-file lock. [alt: pi-durable] (Note I-8). [I113][I114][I115][I116][I117]

## Evidence cited by the mark

- [I113] pi — https://github.com/earendil-works/pi/blob/2126569de40d5595dd3f41f7af126001f04c1de0/packages/ai/src/api/transform-messages.ts#L179-L200 — orphaned tool calls get synthetic "No result provided" — [S]
- [I114] pi — https://github.com/earendil-works/pi/blob/2126569de40d5595dd3f41f7af126001f04c1de0/packages/coding-agent/src/core/agent-session.ts#L2242-L2250 — "Agent is already processing. Specify streamingBehavior…" — [S]
- [I117] pi — https://github.com/earendil-works/pi/blob/2126569de40d5595dd3f41f7af126001f04c1de0/packages/durable/src/harness/generation.ts#L567-L614 — [alt: pi-durable] in-flight tool replay only if `replay: "safe"` (see also packages/durable/src/harness/tool.ts) — [S] (per sub-audit)

## Evidence also cited by the review finding

- [I115] pi — https://github.com/earendil-works/pi/blob/2126569de40d5595dd3f41f7af126001f04c1de0/packages/coding-agent/src/modes/rpc/rpc-mode.ts#L731-L756 — stdin EOF → orderly shutdown awaiting pending work — [S]
- [I116] pi — https://github.com/earendil-works/pi/blob/2126569de40d5595dd3f41f7af126001f04c1de0/packages/coding-agent/src/core/agent-session.ts#L3936-L3976 — provider retry with backoff; `proper-lockfile` not used for session files (grep) — [S]

## Grading record

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