resume

command
v0.26.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Resuming an agent after a crash

This example resumes an agent from its own records instead of a snapshot. It needs no model: the "agent" works through a fixed five-step task, and each step records a turn and updates the working state.

Start a local Polign server with the lease API, then run:

go run ./examples/resume -crash-at 3   # does steps 1 and 2, then exits without releasing
go run ./examples/resume               # waits out the lease, then continues at step 3

The second run prints the briefing it would hand a model: the goal, the remaining plan, what is done, and the last turns verbatim. It then carries on from step 3, because step 2 is the last one its note records.

Run it once more and it resumes a finished task: the briefing shows all five steps done and there is nothing left to do. Use -agent with a new name to start over.

-lease-ttl sets how long a crashed run blocks the next one (10 seconds here, 60 by default in the library). A clean exit releases the lease, so the next run starts at once.

Documentation

Overview

resume shows an agent surviving a crash by resuming from its records, not from a process snapshot. Each run resumes the agent, prints the briefing it would hand the model, then works through a fixed task, recording its turns and working state as it goes. Pass -crash-at to kill the process mid-task without releasing its lease; the next run waits out the lease and continues from the last note.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL