autonomous-resume

command
v2.8.0-dev.5 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

README

autonomous-resume — checkpointed resume of an interrupted run

What this shows

Crash-safe autonomous runs, end-to-end with no LLM credentials, in two phases against one SQLite event log:

  1. Phase 1autonomous.Run capped at MaxTurns(2) to simulate an interruption; the scripted model never gets to call report_done. The driver emits per-turn checkpoint events into the event log.
  2. Phase 2autonomous.Resume with a autonomous.SessionRef pointing at the same log. It finds the latest non-terminal checkpoint, carries turn count + token totals forward, and a fresh scripted model finishes the task. A session lock (acquired automatically) keeps two resumers from clobbering each other.

Run it

No credentials needed, runs offline:

go run ./examples/autonomous-resume

Key APIs

  • autonomous.Run / autonomous.Resume / autonomous.SessionRefgithub.com/go-steer/core-agent/v2/pkg/agent/autonomous
  • eventlog.Opengithub.com/go-steer/core-agent/v2/pkg/eventlog
  • agent.WithAppName / agent.WithSession / agent.WithEventLoggithub.com/go-steer/core-agent/v2/pkg/agent
  • mock.NewScriptedgithub.com/go-steer/core-agent/v2/pkg/models/mock

What you should see

== Phase 1: autonomous.Run with MaxTurns(2) ==
[Phase 1] reason=max_turns_exceeded turns=2 done_detail="" final_text=""

== Phase 2: autonomous.Resume picks up at the next turn ==
[Phase 2] reason=completed turns=3 done_detail="resumed and finished" final_text=""

(A few "Event from an unknown agent ... checkpoint-..." log lines are expected — that's ADK observing the driver's checkpoint events.)

Phase 2's turn count includes Phase 1's — that's the carried-forward checkpoint state.

Next

Documentation

Overview

Example: drive an agent through autonomous.Run, simulate a crash via a tight max-turns budget, then continue the run with autonomous.Resume against the same SQLite event log.

go run ./examples/autonomous-resume

No LLM credentials needed — uses the scripted mock provider.

What this demonstrates end-to-end:

  • Per-turn checkpoint events emitted into a durable event log.
  • autonomous.Resume picking up where the prior run stopped, with turn count + token totals carried forward.
  • The session lock primitive (acquired automatically) preventing two simultaneous resumers from clobbering each other.

Jump to

Keyboard shortcuts

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