Replay & Resume

Replay and resume are scoped in the 0.1.x beta. Native opentine agents can cache-replay, rerun, and resume from transcript state. External harness runs can be inspected, cache-replayed, forked, and rerun only through an explicit harness command. CLI resume requires the saved manifest to declare support.

Cached Replay

Cached replay creates a new run graph that reuses recorded steps. It does not call a model or tool for the reused prefix.

cached_replay.py
1from opentine import Agent, Run
2from opentine.models.anthropic import Anthropic
3
4run = Run.load("finished.tine")
5agent = Agent(model=Anthropic("claude-sonnet-4-20250514"))
6
7replayed = agent.replay_sync(run, mode="cache")
8replayed.save("finished-replay.tine")

CLI Replay

--inspect and --dry-run print recorded steps.--mode cache writes a new artifact that records cache replay metadata.

Terminal
# Inspect recorded steps without writing a new run.
tine replay finished.tine --inspect
tine replay finished.tine --from-step 2 --dry-run

# Cached replay writes a new artifact that reuses recorded steps.
tine replay finished.tine --mode cache --save finished-replay.tine

Harness Rerun

Rerun replay from the CLI requires --harness. opentine passes recorded context to the selected external harness and records the new run.

Terminal
tine replay finished.tine \
  --mode rerun \
  --harness codex \
  --prompt "Rerun this task using the recorded context." \
  --save rerun-codex.tine \
  --compare

Native Resume

Native agents expose agent.resume() and agent.resume_sync(). The agent rebuilds messages from the saved transcript, optionally forks from a selected step, then continues.

native_resume.py
1from opentine import Agent, Run
2from opentine.models.anthropic import Anthropic
3
4run = Run.load("checkpoint.tine")
5agent = Agent(model=Anthropic("claude-sonnet-4-20250514"))
6
7resumed = agent.resume_sync(
8    run,
9    from_step=run.refs.get("main"),
10    prompt="Continue with a concise final answer.",
11)
12resumed.save("resumed.tine")

Run Pause and Load Helpers

Run.pause() and Run.resume() are low-level state helpers. They update status around save/load; they do not execute an agent.

pause_load.py
run.pause("checkpoint.tine")     # marks status paused, then saves
loaded = Run.resume("checkpoint.tine") # loads and marks status running

CLI Resume

tine resume loads the artifact only if manifest.resume is true. Most current external harness profiles do not declare resume support, so the command fails clearly for those runs.

Terminal
# CLI resume is guarded by the saved manifest.
tine resume checkpoint.tine