Pi Durable prototype resumes Android agent work after worker restarts
Mario Zechner's Pi Durable prototype runs an agent runtime on Android while calling remote models. Shared sessions and subagents are supported, and work resumes after worker restarts.

TL;DR
- The agent runtime runs on Android while inference stays remote, as Pi creator Mario Zechner clarified in a follow-up.
- Durability extends to custom application code: after a process crash, work resumes from saved state, according to his explanation.
- The prototype supports shared sessions, selectable providers and models, and artifacts, demonstrated in the updated build.
- The phone app remains a test project: Zechner called it a toy for battle-testing Pi Durable.
Zechner turned worker restarts into hot reload, a delightfully blunt way to make the app edit itself. A guest tried to send an SMS from the phone, but Termux reported its API was unavailable.
Android runtime
Zechner built the prototype directly on the phone in roughly 24 hours, with no cloud VM hosting its agent runtime.
Pi Codemode also runs inside Termux on Android:
Checkpoints and tool replay
Pi Durable's recovery example opens the same persisted storage in a replacement process, then calls harness.resume() to continue unfinished tasks from their checkpoints. SQLite and JSONL provide persistent storage; the in-memory backend does not survive process death.
The documented recovery behavior distinguishes:
- Interrupted model requests: send the request again; preserve the partial answer in the transcript, marked aborted.
- Interrupted tool calls: rerun tools declared
replay: "safe"; otherwise tell the model the call was interrupted, including output captured so far. - Queued messages: retain their place in the queue.
- Retried submissions: reuse the original submission when the client supplies the same
requestId, rather than enqueueing it twice.
In an independent kill-9 test, a replay-safe search ran again while an unsafe booking was reported as interrupted instead of repeated.
Worker hot reload
Zechner split reloads into two paths:
- Web UI: hot module replacement.
- Server and session workers: kill and respawn the processes; Pi Durable recovers their saved work.
Ordinary Pi lost in-flight work in that server-and-worker setup, he explained in a comparison. Durable resumes it automatically after the restart.
Shared sessions
Zechner exposed the phone-hosted server through ngrok and reported 130 concurrent viewers.
Pi Durable's multiplayer documentation describes three client behaviors:
- Join or reconnect: receive the current transcript, streamed answer, running tools and their output, queued messages, agent configuration, and usage.
- Stay connected: subscribe to changes after receiving that initial view.
- Send input: steer a running conversation after its current tool calls, or queue a follow-up.
One process owns each storage backend, with other clients attaching to that process, according to Earendil's storage design.
Subagent conversations
The phone app exposes subagents. Pi Durable leaves their implementation to application code; its reference example creates child conversations owned by a tool task.
- Each child can have its own model, tools and instructions, and tracks its own cost.
- A replay-safe parent tool locates the existing child after a restart and waits for the same submission's answer.
- Aborting the owning tool call also aborts its child conversation.
The initial Android prototype with subagents
Experimental packages
Pi Durable shipped alongside Pi 1.0 on October 1 as an experimental, MIT-licensed package. Earendil's announcement lists this installation command:
- Cloudflare: Zechner reported integration into the Agents SDK.
- Unfinished components: he flagged server, client, protocol and Chord as heavy works in progress.
- Telemetry: he said it was not wired up yet when discussing the framework.
Foreground service
The Android runtime uses a foreground service, Zechner said in a battery discussion. He attributed its low battery use to spending most of its time waiting for model responses, while flagging Rust compilation as a more demanding workload.
On his Pixel 11, he reported 24 hours of continuous operation without exhausting the battery.