Preserve and resume in-progress multi-agent work across OpenClaw config patch/apply restarts. Use when a restart is required during active tasks, when users...
Use this workflow to maximize successful recovery after OpenClaw restart.
Before any gateway.config.patch, gateway.config.apply, gateway.update.run, or gateway.restart:
sessions_list).sessions_history, limit 20-50).memory/restart-checkpoints/<YYYY-MM-DD>/<HHmmss>.mdKeep checkpoint concise and executable.
When calling gateway restart/config change, set note to include recovery intent, e.g.:
After restart:
sessions_list) and compare against checkpoint.sessions_send:
When resuming tasks, enforce:
Use script: scripts/build_checkpoint.py to generate checkpoint markdown from structured JSON.
Example:
cat session-snapshot.json | python3 scripts/build_checkpoint.py memory/restart-checkpoints/$(date +%F)/$(date +%H%M%S).md
Expected stdin JSON shape:
{
"sessions": [
{
"sessionKey": "agent:engineer:main",
"agentId": "engineer",
"goal": "Finish regression verification",
"lastDone": "401/幂等/时区/retention case passed",
"nextStep": "Publish final acceptance summary",
"blockers": "none"
}
]
}
Use script: scripts/generate_resume_plan.py to parse the latest checkpoint and produce a structured resume plan.
Example:
python3 scripts/generate_resume_plan.py memory/restart-checkpoints/2026-03-09/162200.md /tmp/resume-plan.json
Then send each items[].resumeMessage to items[].sessionKey via sessions_send.
Rules:
Use script: scripts/recover_from_latest_checkpoint.py.
It auto-selects the latest checkpoint file and emits a ready JSON payload list for sessions_send calls.
Examples:
# Use latest checkpoint automatically
python3 scripts/recover_from_latest_checkpoint.py > /tmp/recover-actions.json
# Use a specific checkpoint
python3 scripts/recover_from_latest_checkpoint.py memory/restart-checkpoints/2026-03-09/162200.md > /tmp/recover-actions.json
Execution guidance:
/tmp/recover-actions.jsonactions[] item with sessions_sendUse script: scripts/pre_resume_verify.py to score resume actions before sending.
Examples:
python3 scripts/pre_resume_verify.py /tmp/recover-actions.json /tmp/recover-verified.json
Behavior:
risk=normal|highhigh risk actions are set to decision=hold and requiresManualConfirm=truedecision=send automaticallyRecommended execution flow:
decision=senddecision=hold list to user for explicit confirmationUse script: scripts/execute_verified_recovery.py with V5 output.
Example:
python3 scripts/execute_verified_recovery.py /tmp/recover-verified.json > /tmp/recover-exec.json
Behavior:
sendActions[] for auto-safe resumes (decision=send)holdForManualConfirm[] for risky resumes (decision=hold)Execution:
sendActions[] with sessions_sendholdForManualConfirm[]Read and use: references/templates.md
ZIP package — ready to use