Replay costs nothing
Recorded completions are served from the log, so reconstruction is the same bytes rather than a similar answer. Zero provider calls, enforced in the controller and covered in CI.
$agentctl exec --input "hello world"session sess-6ff29e8d93d3a4c65f6f38bcseq=1 EVENT_INPUT user: hello worldcalling providerseq=2 EVENT_MODEL_CALLseq=3 EVENT_OUTPUT assistant: echo:hello worldseq=4 EVENT_ENDone turn, journaled and hash-chained$agentctl replay --session sess-6ff29e8dseq=1 EVENT_INPUT user: hello worldseq=2 EVENT_MODEL_CALLseq=3 EVENT_OUTPUT assistant: echo:hello worldseq=4 EVENT_ENDbyte-identical, and the provider was never calledNearly every agent framework lets the agent call the provider. The completion then exists only in the agent’s memory, so the log can describe what happened but never rebuild it. Re-running is the best on offer, and a re-run drifts.
Here the host performs the call on the harness’s behalf. The completion passes through the host on its way back and lands in the journal as a record. Look for the arrow to the provider: it leaves the host, and the sandbox has none.
Exec, and records stream back as they commit.Replay costs nothing
Recorded completions are served from the log, so reconstruction is the same bytes rather than a similar answer. Zero provider calls, enforced in the controller and covered in CI.
Fork is not a re-run
Children inherit the parent’s prefix and diverge independently, so a fan-out starts from identical state at no model cost.
Placement is checked first
A harness declares what it needs to survive a resume and a runtime declares what it offers. Impossible pairings are refused before compute is provisioned, so the system degrades honestly instead of resuming wrong.
A plain Deployment and a PersistentVolume: no substrate, no memory snapshot. A turn, a second turn, a free replay, a two-way fork, suspend and resume, then the pod is deleted and a different pod picks the session up mid-conversation.
hack/demos/kubernetes-tour.sh against deploy/kubernetes/agentsessionsd.yaml. Nothing is staged: the replay after the pod dies is served from the journal, so the model is called zero times.The same lifecycle with each session’s actor in a micro-VM. Resume brings back the same actor with its memory, replay calls the model zero times, and a snapshot that cannot restore that memory is refused.
A two-minute recording of the lifecycle page from examples/session-lifecycle-ui, driven against a kind cluster whose actors run in micro-VMs, with a caption for each of six steps. One: a memory-tier session is created and runs a turn, which places its actor on a micro-VM worker with one model call. Two: suspend checkpoints the actor, which shows SUSPENDED with a MEMORY snapshot. Three: resume restores it, RUNNING with the same actor UID, and a second turn's reply still lists the first turn's issue. Four: a fork at the head starts a child session whose own turn carries the parent's two issues plus a third. Five: a stateless-tier session runs a turn and is replayed; the controller counts zero model calls and the fake model's counter does not move. Six: on a template that takes VOLUMES snapshots, suspend is refused with FailedPrecondition, required MEMORY, observed VOLUMES. The end card repeats the claim: the same actor after resume, and zero model calls on replay. The model is a fake model.
examples/session-lifecycle-ui, whose README brings it up with the example's up.sh and ui.sh; the micro-VMs need /dev/kvm in the Docker host. The model is a fake model that counts its calls, and the count did not move during the replay.Three contracts. One neutral wire form with a Go SPI, and Event is shared by the log and the
harness stream, so what is journaled is exactly what the harness emitted.
Sessions
CreateSession Exec ForkGetSession Replay SuspendListSessions ResumeHarness
Describe the static contractRun drive one turn, emitting typed eventsRuntime
Create Restore StopSnapshot Fork Status CapabilitiesThree runtimes ship. runtime/local is filesystem-only and refuses a memory-snapshot harness
rather than resuming it wrongly. runtime/remote attaches to a harness you are already running,
so your agent is registered by address rather than compiled into the server. runtime/substrate
runs both capability tiers against a real cluster on every pull request with substrate-relevant
changes, both on a micro-VM. Kata, Cloud Hypervisor, and plain pods fit the same SPI. No provider
SDK appears anywhere, and CI asserts the core links no backend vendor.
go install github.com/agent-primitives/sessions/cmd/agentctl@v0.4.0Signed archives and container images are on the latest release.