Earendil ships Pi 1.0 alongside Pi Durable, an experimental harness for long-running agents
- Earendil shipped Pi 1.0 and, alongside it, an experimental package called Pi Durable, a harness for long-running, malleable agents that runs anywhere there is a JavaScript runtime; Pi Durable does not replace the Pi coding agent.
- The whole source, without tests, is about 15,000 lines, which counts as roughly 150,000 tokens with GPT and 250,000 with Claude; the storage backends alone are 3,000 lines an agent can usually skip.
- Pi Durable opens a harness over a storage backend and ships memory, SQLite, and JSONL storage plus a conformance suite and benchmarks; the SQLite and JSONL code uses no Node APIs, so with a small adapter it runs on Bun or inside a Cloudflare Durable Object.
- On SQLite the harness keeps only the working set in memory (active transcripts, live tasks, pending submissions), and compaction bounds transcripts by the model's context window, so conversations with tens of thousands of messages fit in memory.
- Tools get files and a shell from an execution environment; Pi Durable ships a Node execution environment and a small interface for remote ones, so the harness can run on one machine while its tools run on another, and one process owns a storage at a time while other clients attach to it.
Hacker News opinions
Good to see Pi doing a durable harness. I've been building in this space for a while and it's a super interesting place: LangChain Deep Agents, Vercel Eve, OpenAI Agents API, Anthropic Managed Agents are all shipping here. Durable unattended runs, separating harness from compute, and multiplayer are the reasons.
It's a well understood problem with a lot of wrinkles. I can't count how many earlier designs we chewed through before landing on the final one, and I'd bet we learn more.
150k tokens with GPT and 250k with Claude out of the same 15k lines? That's a wild gap for token counting.
Don't get the labs started on tokenization schemes lol. Some of that delta is newish, there's an OpenRouter writeup on the Opus 4.7 tokenizer.
I built my own version of this for Pi, curious whether I can just replace it now.
Wish the durable state wasn't restricted to JSON documents. I want an outbox pattern so external stores stay in sync with conversation state.
You can sort of do it with a task today: commit an entry on the root conversation, durably schedule a background task in the same commit, then read the entry by id and upsert it to postgres idempotently. What's missing is sugar, a hook that runs inside each commit so the outbox write is atomic with the state change.
Sandboxing looks BYO to me. I'd want a policy engine, maybe an NVIDIA openshell extension. Also, most of the durability comes from persisting JSON documents and keeping little in memory. My own JSONL event store experiments made me prefer keeping things in memory, or just a straight .db file. Am I crazy?
The multi-user part is what I like most. It should make my remote control tool easier, since I've been hacking around not being able to use ACP while the TUI is active.
I'm building a Slack harness on the Pi SDK for our on-call and support channels. Started with Codex but Pi is more hackable and vendor-agnostic. On Kubernetes the JSONL session files and pod interruptions add complexity, so I'm using DBOS. This came at the right time.
I'm shoving it into Agent Substrate on Kubernetes with a different storage interface.
What are people actually using infinitely running agents for?
Cron jobs that monitor projects and ping me through my claw agent in Telegram. When it messages me I ask it to fix the issue in the same conversation.
I don't get the infinitely running case, but I schedule agents to open PRs when events happen, or triage alerts every day.
This stuff is really complicated. Coordinating multiple vanilla Pi instances was a nightmare for me. Not sure the added complexity pays off, but fair play for labelling it experimental.
Durable doesn't support branching conversation trees, only forks with ancestry information. That's a big break from original Pi. Branching conversations are an immutable data structure, so why would the durable guarantees need that?
Disappointed these harnesses still don't treat sandboxing as first class. I want declarative rules for which sandbox agents execute in and context marked tainted when untrusted. It's halfway to replicating pieces of Gastown.
Hard to trust a sandboxing layer built into a harness this focused on being fully pluggable and self-improvable. When I use Pi to write extensions for Pi, I'd rather wrap Pi in a separate OS-level sandbox.