Unwinding and Draining Agent Work Safely

Lesson 4 of 4

Replay Once, Then Report

Estimated time: 10 minutes

Replay once, then report the shape

Work recorded at the deadline is replayed after the worker is back, and it is replayed once. A replay loop that runs on every boot turns one unfinished task into a repeated side effect.

The recovery report names the steps that were applied, the steps that were undone and the steps that were skipped. A person finishing by hand needs that map, and a single success word erases it.

openclaw runbook add   --name "Unwind and Drain"   --trigger "/runbook unwind"   --tags "automation,recovery"   --steps "List committed steps, run each undo in reverse order, record anything unfinished, then replay once."

Keep the two patterns together in one runbook. A drain that finds unfinished work and a workflow that committed part of its steps are the same recovery problem seen from two ends.