research/durable-agent-runtime/sources.md
hermes 686d02755f durable-agent-runtime: add pi-durable deep dive + crash/replay experiments
- new pi-durable.md: architecture (session/entry/document/task/submission),
  effect-sandwich semantics, structured concurrency, storage backends,
  maturity/adoption, taxonomy placement, implications for hermes-vm
- empirical tests on @earendil-works/pi-durable 1.3.0 (Node 22.22.2):
  kill -9 mid-phase (memo vs plain), kill -9 mid-tool (safe vs unsafe),
  SQLite schema; noted cold-open waitForTask race and the main-vs-1.3.0
  version gap (sleepUntil/onWake/restartLimit/sleeping not published)
- taxonomy: durable harness library added as a new primitive family
- sources + next-steps updated
2026-10-20 13:20:24 +00:00

9.1 KiB

Sources — Durable Agent Runtimes & Harness Engineering

Part of durable-agent-runtime/index

Full reference list for the research topic. One line per source: what it is, why it matters.

Amp Orbs (remote sandbox + durable agent loop)

  • Agents in Orbs (Amp news, 2026-06-30) — launch announcement. Orbs = machines where agents run without supervision; fresh orb per thread with code/plugins/tools; 32GB/16-core default, $1.32/hr, billed by the minute, auto-pause after 5 min idle.
  • Putting an Agent in an Orb (Amp note, 2026-07-02) — the deep-dive: .agents/setup + .agents/resume repo hooks, snapshot reuse up to 24h, dev-server skill (ensure-dev-server.sh), /__dev auth endpoints, .amp/dev-ports.json, .amp/in/ logs, 41 AGENTS.md files.
  • What I Want to Tell You About Orbs (Amp note, 2026-08-04) — philosophy/experience piece. "Ingredients": secure sandbox, scale to zero, ephemeral, durable agent loop, controllable from web/phone/desktop, portals, multiplayer, automations. Evidence-first workflow: agents must produce proof (screenshots, videos).
  • Orbs manual (Amp docs) — full spec: orb sizes, billing, .agents/setup/.agents/resume/.amp/services.yaml/portals, webhooks (event-driven orbs), OIDC workload identity (amp orb id-token), secrets hierarchy (personal > project > workspace).
  • Amp Security Reference — the architecture disclosure: Amp Client (CLI) + Amp Server (GCP multi-tenant, PostgreSQL thread storage) + e2b for sandbox compute; providers (Anthropic/OpenAI/xAI/Meta/Gemini/Bedrock/Baseten/Fireworks for inference, WorkOS auth, Stripe billing). No self-hosted deployment offered.

Durable objects / durable execution

  • denoland/celld (GitHub) — self-hosted, distributed Durable Objects. Each object is its own SQLite DB, replicated to an S3-compatible bucket; nodes coordinate through the bucket with no control plane/consensus. V8-embedded, runs Wrangler bundles. Idle cells hibernate. By Deno Land (ry@deno.com). ~222★, Apache-2.0.
  • rivet-dev/rivet (GitHub) — Rivet Actors: long-running lightweight processes for stateful workloads. In-memory state + automatic persistence (SQLite/BYO DB), ~20ms cold start, ~0.6KB memory/instance, scale to zero, WebSockets/queues/workflows/scheduling, global edge. Self-host (single Rust binary) or cloud. ~5.8k★, Apache-2.0. Engine sub-components: Pegboard (orchestrator), Gasoline (durable execution), Guard (traffic proxy), Epoxy (multi-region KV, EPaxos).
  • celld.dev docs — official docs for celld (deployment, limitations, security pages).

Sandbox / VM runtimes

  • kernel/hypeman (GitHub) — multi-hypervisor VM runtime for OCI images: Cloud Hypervisor, Firecracker, QEMU on Linux; Apple Virtualization.framework on macOS. Docker-compatible CLI (run, exec, ps, logs), standby/restore (snapshot VM to disk, resume in ms), built-in ingress/TLS/subdomain routing, GPU passthrough, remote JWT-authenticated API. ~303★, MIT.
  • e2b-dev/infra (GitHub) — infrastructure powering E2B Cloud: Firecracker-based sandbox VMs for AI agents, template system, snapshot cold starts (sub-30ms). Open source; the substrate Amp orbs run on (per Amp's security reference). Also E2B docs: e2b.dev.
  • Spheron guide: E2B vs Daytona vs Firecracker (2026) — sandbox architecture comparison: E2B managed (CPU-only, snapshot cold starts), Daytona, Firecracker. Snapshot-restore + sandbox pooling math for cold-start latency.

Durable harness library — pi-durable

Researched 2026-10-20 against main (48c8f32) and published 1.3.0; full write-up in durable-agent-runtime/pi-durable.

  • packages/durable README — API tour: concepts, persist/resume, extensions, tools, code mode, settings, environment, compaction, child tasks, storage, errors. Documents some unreleased features (durable sleeps, onWake, crash-loop guard) not present in 1.3.0.
  • packages/durable docs/spec.md — normative spec (~5.6k lines). Key sections: §1 invariants, §5.2 effect sandwich, §5.5 structured concurrency, §8.3 generation recovery, §8.4 tool replay policy, §12 API footguns, §13 non-goals.
  • packages/durable CHANGELOG — 1.0.0 (2026-10-01) through 1.3.0 (2026-10-15); Unreleased has breaking changes (removes TaskRuntime.sleep(), SQLite schema v2 with no rollback).
  • packages/durable package.json — v1.3.0, MIT, Node >= 22.19; deps: pi-ai, chord, pi-codemode, pi-telemetry, TypeBox, Photon, diff.
  • packages/chord README — document-state substrate: objects at addresses, observable JSON, delta tracking, hot reload, SQLite adapters.
  • Earendil, "Pi Durable" launch post (2026-10-01) — vendor positioning and architecture tour; claims ~15k LOC excluding tests, "runs anywhere there is a JavaScript runtime", multi-client/multiplayer design; FAQ says a Rust port is possible but not planned.
  • npm: @earendil-works/pi-durable — first publish 2026-09-19; 16 versions; 1.3.0 latest as of 2026-10-20; npm API reports 387,665 downloads for the week ending 2026-10-18.
  • GitHub: earendil-works/pi — monorepo metadata at 2026-10-20: 116,619 stars, 14,877 forks, MIT; packages/durable has 175 path commits (oldest API result 2026-09-18), 1.0.0 released 2026-10-01.

Empirical (this research, 2026-10-20): installed 1.3.0 under Node 22.22.2; ran faux-provider chat, SIGKILL mid-task with/without runtime.memo, SIGKILL mid-tool for replay: "safe" vs default unsafe, and dumped the SQLite schema. Results and caveats (including a cold-open waitForTask race) are in durable-agent-runtime/pi-durable.

Harness engineering / agent-as-library

  • gakonst/nanocodex (GitHub) — library-first Rust reimplementation of the Codex harness ("blazing-fast, minimal, library-first"). Typed turns/tool registry/event streams/steering/cancellation/forks over the OpenAI Responses WebSocket API. Agent session lives in your process; no app server or durable control plane. Crates: facade, agent lifecycle, typed OpenAI boundary, tools (shell/Code Mode/MCP), observability (OTel), experimental voice + VM-backed tools. Thin CLI/TUI, Python, Node/WASM, React consumers. Auth shares ~/.codex/auth.json.
  • tact (github.com/clabby/tact) — a terminal interface for nanocodex, launched Jul 2026; browser-based /review interface (agent-authored visual code review). Proof of the build-your-own-agent-on-nanocodex loop.
  • Cloudflare: Code Mode — the better way to use MCP (blog, 2025-09-26) — converts MCP tool schemas into a TypeScript API and asks the LLM to write code that calls the API, instead of presenting tools directly. Run in a sandboxed V8 isolate via the Worker Loader API; no containers. Finding: LLMs are much better at writing code than at synthetic tool-call tokens; avoids copying intermediate tool results back through the context.
  • Cloudflare Agents SDK codemode docs — the codemode helper + worker loader usage.
  • Prime Intellect: Recursive Language Models (blog, 2026-01-01) — RLM paradigm: persistent Python REPL as the model's only tool, context as a variable, sub-LLM calls as functions. Related arXiv: 2512.24601 (Recursive Language Models), 2605.09998 (Continual Harness: Online Adaptation for Self-Improving Foundation Agents).

Context from our own work

  • Buzz thread origin: buzz://d8a718be-031f-4a6e-9f5c-a55466641654/91604ae52f7fc33d6e43543f3b7c355f65f353d4a6bc820b6dd8e8d0fd70f2ae (Amp Orbs research) and the triggering event for this topic.
  • Workspace note: RESEARCH/AMP_ORBS_REMOTE_DEV.md — Amp Orbs deep research with system-design follow-up (E2B substrate, lifecycle, mapping to our stack).
  • Session research on nanocodex (2026-07-31): library-first Rust SDK, vs Codex/pi/OpenCode positioning, reviewer-harness relevance.
  • clan-private: machines/hermes-vm/configuration.nix (hermes-vm host config), modules/dev/containers.nix (rootless podman enabled), services/buzz/ (Buzz relay/gateway/agents), herdr (persistent PTY / tmux replacement).