/ durability
04 Durability, Recovery & Orchestration
Day 4. Real agents crash, get interrupted, and hit jobs too big for one context. We make the harness recoverable and self-healing, and teach it to dispatch sub-agents under supervision.
→
Durable execution & checkpointingDURABLE
Wrap every model turn and tool call as a step whose result is persisted. If the process dies, replay returns the cached results instead of re-running the work.
→
Replay & resumable sessions
How a durable event log lets a session resume exactly where it left off after a crash, a disconnect, or a restart, with no lost work and no duplicate side effects.
→
Self-healing loops: retries & failure classification
Not every error is fatal. Classify failures (transient vs terminal), retry with backoff, and let the loop recover on its own instead of dying on the first hiccup.
→
Sub-agents & handoffs
When one context can't hold the job, spawn a focused sub-agent, let it work, and return only its conclusion. Handoffs vs. sub-agents, and when to use each.
→
Supervision & plan mode
A supervisor that makes a plan, dispatches sub-agents to execute steps, and synthesizes their findings. Plan-mode as a safety and quality mechanism.
→
Human-in-the-loop: plans, approvals, escalationBUILD
Some actions should wait for a human. Building the approval gate and escalation path, and the checkpointed dispatcher that ties durability and orchestration together.
