Skip to content

feat(runtime): durable run loop — wire supervisor resume + journal the kernel loop#346

Draft
drewstone wants to merge 1 commit into
mainfrom
feat/run-loop-durability
Draft

feat(runtime): durable run loop — wire supervisor resume + journal the kernel loop#346
drewstone wants to merge 1 commit into
mainfrom
feat/run-loop-durability

Conversation

@drewstone

@drewstone drewstone commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Durable run loop

Makes an agent run survive a worker crash or restart by wiring the run loop onto durable journals, reusing the runtime's existing resume primitives.

  • Supervisor resumecreateSupervisor().run() loads an existing tree and rehydrates settled children (replaySpawnTree / materializeTreeView) instead of always starting fresh. These primitives were already built and tested; this wires them in.
  • Durable journal by default — the run context uses the file-backed SpawnJournal instead of the in-memory one, so a run's progress is durable without the caller opting in.
  • Kernel loop journal — each committed iteration is journaled; a restart resumes from the last committed offset rather than re-running from the start.

Verification

A run killed mid-flight and reloaded resumes from the last committed step and does not redo committed work.

Relationship to the shared package

The kernel journal and tool-call repair are the agent-runtime consumer of the shared durability primitives (@tangle-network/sdk-core/durability); once that package publishes, this re-points onto the shared contract so the runtime and the sandbox/cli-bridge paths share one recovery story.

…e kernel loop [WIP]

Build-stage durability work captured as a draft for review/resume. See PR comment for spec, checklist, completion criteria, ranked alternatives, decisions, and resume steps.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant