Durable harness for long-running agents from the team behind the Pi coding agent. It checkpoints every step so a run survives crashes and evictions, and it now runs inside a Cloudflare Durable Object through the Agents SDK's PiHarness.
Pi is Mario Zechner's minimal, MIT-licensed agent harness, now developed under Earendil. You extend it with extensions, skills and prompt templates, and it runs interactively, in print/JSON mode, over RPC or as an SDK. Pi Durable shipped with Pi 1.0 on 1 October. It isn't a new coding agent. It's a framework for building any long-running agent app on Pi's model layer, and the Pi coding agent itself is one of the examples. It's marked experimental and the API may still change.
Every model call, tool call and compaction is a task, and each step stores a checkpoint before moving on. After a crash, a new process opens the same storage and picks up unfinished tasks. An interrupted model request is sent again. A tool call is rerun only if it's declared safe to replay, and otherwise the model is told it was interrupted. Clients pass a requestId so a retried submission is accepted exactly once. Storage can be memory, SQLite or JSONL, and the storage code avoids Node APIs, so it runs on Bun or inside a Durable Object.
Cloudflare added it to the Agents SDK in agents@0.26.0 as PiHarness (agents/harness/pi). Pi runs the loop, and the SDK provides storage in the object's SQLite database (tables prefixed pi_) plus a Lifecycle job that wakes an evicted object so the run continues. Install with npm i agents @earendil-works/pi-durable @earendil-works/pi-ai. The docs list current limits: no tool-call approvals and no event-stream replay. Source: earendil-works/pi · write-up: Pi Durable.