--- title: Durable Agent Runtimes & Harness Engineering description: Survey of durable, stateful agent execution primitives — durable objects (celld), actors (rivet), multi-hypervisor VM runtimes (hypeman, E2B/Amp Orbs), harness-as-library (nanocodex), code-as-tool-calling (Cloudflare Code Mode) — and what they mean for building a self-hosted orb-like runtime on hermes-vm. status: active category: technical tags: [durable-objects, actors, agent-runtime, agent-harness, sandbox, microvm, self-hosting, orbs, stateful, durable-execution] draft: true created: 2026-08-07 updated: 2026-08-07 origin: buzz://d8a718be-031f-4a6e-9f5c-a55466641654/4123d35532d0b2cbfb80a0a34f79fb3e4e63c16c25b77d43bc0f10bb178e4f1b --- # Durable Agent Runtimes & Harness Engineering ## Summary Research into how modern agent execution environments achieve **durability and statefulness** — where agent state lives, what compute primitive runs the agent, and how the environment hibernates and wakes. Covers the spectrum from in-process harness libraries (nanocodex) and V8 isolates (celld, Cloudflare Workers) to actor runtimes (rivet) and microVM sandboxes (hypeman, E2B/Amp Orbs). Goal: derive a build plan for a self-hosted, orb-like runtime on our NixOS VM (hermes-vm) without overbuilding. ## Research Question What are the architectural primitives for building a durable, stateful agent runtime (sandboxed or not), and which combination fits a single self-hosted NixOS dev VM? ## Scope - Included: durable objects / durable execution (celld, rivet, Durable Objects), agent harness engineering (nanocodex, Amp orbs, Prime Agent RLM), sandbox runtimes (hypeman, E2B, Cloudflare isolates), tool-calling vs code-calling (Cloudflare Code Mode) - Excluded: model training/inference infra, prompt engineering, RLHF - Sufficient answer: a taxonomy of primitives + a recommendation for what to build (and what NOT to build) on hermes-vm ## Key Findings - **The 2026 pattern is unanimous**: agent compute is disposable, agent state is durable elsewhere. Amp: sandbox is ephemeral, the thread (prompts, tool calls, results) lives on the server. celld: nodes are replaceable, the S3 bucket is the source of truth. Rivet: actor state persists while the process may hibernate. - **Four primitive families emerged**: 1. Durable object/execution stores — celld (each object = its own SQLite DB, S3 replication, no consensus) 2. Actor runtimes — rivet (in-memory state + persistence, ~20ms cold start, scale to zero, queues/workflows/scheduling) 3. Sandbox/VM runtimes — hypeman (multi-hypervisor OCI-in-VM), E2B (Firecracker microVMs, snapshot restore, used as Amp's orb substrate) 4. Harness libraries / agent loops — nanocodex (Rust, agent as in-process library, typed events over WebSocket), Codex, pi, Prime Agent RLM - **Scale-to-zero / hibernation is universal**: Amp orbs pause after 5 min idle; celld cells hibernate; rivet actors hibernate when idle; hypeman standby = snapshot VM to disk, resume in milliseconds; E2B snapshot reuse gives sub-30ms cold starts. - **Tool interaction is converging on "code as the tool interface"**: Cloudflare Code Mode converts MCP tools into a TypeScript API and has the LLM write code that calls it (LLMs are far better at code than at synthetic tool-call tokens). nanocodex's thesis is the same: typed events beat stdout parsing. Prime Agent's RLM: a persistent IPython REPL is the model's only tool. pi's minimalism: 4 tools, no MCP bloat. - **Two hard problems everyone solves**: (a) cold start latency (actor ~20ms vs VM ~30s, mitigated by snapshot/pooling), (b) state checkpointing and recovery (SQLite replication, thread JSONL, VM snapshots, actor state persistence). - **For our stack**: hermes-vm is already a durable compute host (systemd services, kanban DB, session DBs, herdr panes). The real gap is a per-task disposable environment contract + event wake, not a distributed state layer. celld/rivet solve problems we don't have on a single box; hypeman is interesting for per-task VMs but likely overkill. ## Sources For the full reference list see [[durable-agent-runtime/sources|Sources]]. - [[durable-agent-runtime/sources|Sources]] — all links, one-line descriptions ## Detail Files - [[durable-agent-runtime/sources|Sources]] — full reference list - [[durable-agent-runtime/analysis|Analysis]] — taxonomy, comparison matrix, implications for our build - [[durable-agent-runtime/next-steps|Next Steps]] — follow-up questions and build plan ## Related Research - Amp Orbs research note (workspace): `RESEARCH/AMP_ORBS_REMOTE_DEV.md` - Prime Agent / Continual Harness (arXiv 2605.09998) — self-improving harness state - Forgejo AI reviewer harness (workspace skill reference) — where nanocodex was first evaluated ## Discussion Triggered from the Amp Orbs thread (2026-08-07). User connected the dots: orbs, nanocodex, durable objects (celld), actors (rivet), multi-hypervisor VM runtimes (hypeman), and Cloudflare Code Mode all belong to one research area — "durable object, stateful machine, harness engineering either sandboxed or not." Asked for centralized structured research he can digest, with the option of parallel Luna delegation. Completed directly (all primary sources already extracted; delegation channel has known instability). ## Next Steps - [ ] Decide Phase 1 scope: per-repo `.agents/setup`-style contracts + AGENTS.md per repo on hermes-vm - [ ] Evaluate hypeman as an opt-in per-task VM runtime (snapshot/standby) vs NixOS containers - [ ] Revisit Code Mode pattern for our Effect TS stack (tools as typed API, not tool-calling) ## Conclusion The research area is **durable, stateful agent runtime and harness engineering — sandboxed or not**. Four primitive families cover the space; for a single self-hosted NixOS VM the right move is environment contracts + event wake on the existing durable host, not building a distributed durable-object layer.