Expand description
Restart recovery: bring a freshly-spawned agent back to its persisted running state so the daemon resumes it where it stopped.
When the daemon restarts, the CLI reloads each non-terminal run’s blueprint
and spawns a fresh agent, then calls restore_agent to overlay the persisted
context, jump to the persisted stage + iteration, and restore token totals. The
agent keeps the ReadyToInfer marker spawn_agent set, so any inference
that was in flight when the daemon stopped is re-issued on the next tick -
nothing is left stuck awaiting a job that died with the old process.
Enums§
- Restore
Priority - How urgently a persisted run should be brought back on restart. Ordered so a
higher value restores first (see
triage_restores).
Functions§
- classify_
restore - Classify one persisted run for restart recovery from its on-disk status and
whether it is parked mid fan-out (a
<run_dir>/fanout.jsonis present). - restore_
agent - Restore a just-spawned
entityto the persisted state captured insnapshot(its context),stage_index+iteration(its position), andtotals(its running token/tool counts). The agent staysActive+ReadyToInferso it resumes on the next tick. - triage_
restores - Triage a set of persisted runs into the order they should be restored on
restart: drop terminal runs, then rank the rest actionable-first
(
RestorePriority::ActivebeforeBlocked), breaking ties by most-recently updated. Each input is(meta, parked_on_fanout)whereparked_on_fanoutis whether the run has afanout.json(seeclassify_restore); the returnedRunMetas are ready to reload in order.