Skip to content

Commit bca74dd

Browse files
abrichrclaude
andcommitted
fix: improve checkpoint resume UX with VM state guidance
Show the next step and prompt user to verify VNC matches expected state before resuming. Default changed to No since fresh start is the safe choice — resume is only valid after tunnel drops, not VM reboots. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 323aad7 commit bca74dd

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

scripts/record_waa_demos.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1678,17 +1678,24 @@ def _hard_reset_task_env() -> bytes:
16781678
print(" Waiting for screen to stabilize...")
16791679
return _wait_for_stable_screen(server)
16801680

1681-
# Check for existing checkpoint (resume support)
1681+
# Check for existing checkpoint (resume support).
1682+
# Resume is only meaningful if the VM state is intact (e.g. after a
1683+
# tunnel drop or script crash). If the VM was rebooted, resuming
1684+
# would put the recording out of sync with the actual screen.
16821685
checkpoint = _load_checkpoint(task_dir)
16831686
resuming = False
16841687
if checkpoint is not None:
16851688
n_done = len(checkpoint["completed_steps"])
16861689
n_left = len(checkpoint["remaining_steps"])
16871690
ts = checkpoint.get("timestamp", "unknown")
1691+
next_step = checkpoint["remaining_steps"][0] if checkpoint["remaining_steps"] else "(done)"
16881692
print(f"\n Checkpoint found: {n_done} step(s) completed, "
16891693
f"{n_left} remaining (saved {ts})")
1690-
answer = input(" Resume from checkpoint? [Y/n] ").strip().lower()
1691-
if answer in ("", "y", "yes"):
1694+
print(f" Next step would be: {next_step}")
1695+
print(f"\n Check VNC ({vnc_url}) — does the VM match where you left off?")
1696+
print(f" Resume is only valid if the VM was NOT rebooted since the checkpoint.")
1697+
answer = input(" Resume from checkpoint? [y/N] ").strip().lower()
1698+
if answer in ("y", "yes"):
16921699
resuming = True
16931700

16941701
if resuming:

0 commit comments

Comments
 (0)