Guides

Snapshot-driven retries

Make an agent's failures cheap: snapshot first, try, verify, and restore before the next attempt. The agent pattern that works:

  1. snapshot_take {label: "before-<task>"}
  2. try the change (vm_exec)
  3. verify (exit code, test output, or a vm_screenshot compared against what you expect)
  4. on failure: snapshot_restore and retry with a changed plan — not the same command again

Deterministic retries beat prompting harder: the machine is always back to a known-good state, so the agent's next attempt starts clean. The lab egg's failing test (learn/agent-lab, /opt/repo) is a good place to feel this — snapshot, let the agent edit calc.py, run pytest, restore if it made it worse.

Next: Eggfile