Repository navigation
fix(update): name the next step for interrupted state restores - #188304
Conversation
Update commands refused an interrupted shared-database publication with text that named no next action. The refusal now names the blocking .openclaw-restore-* directory, says it may hold the only copy of the original database, and links a new repair-and-recovery section: keep the directory, copy the state directory, restore a verified backup into a fresh directory, or get support. Recovery policy and read-only behavior are unchanged.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs changes before merge. What this changesThis PR names the interrupted restore directory and links instructions for preserving state and recovering from a verified backup. Example: An operator runs openclaw update repair --yes with /srv/openclaw/state/.openclaw-restore-example-0 present.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains This PR provides useful recovery guidance while preserving the intentional safety refusal, but its changed message breaks two existing consumer test groups. Priority: P2 Before merge
Findings
Tests
Agent review detailsHow this fits togetherUpdate admission inspects the shared database directory before opening update state; interrupted restore artifacts produce a read-only refusal consumed by repair, finalization, rollback, and reporting paths. flowchart TD
A[Update or repair command] --> B[Recovery admission]
B --> C[Inspect database directory]
C --> D[Interrupted restore found]
D --> E[Refusal with path and recovery link]
C --> F[Continue existing admission]
Technical reviewBest possible solution: Keep the existing read-only admission owner and recovery guidance, and update both remaining consumer assertions to the new refusal contract. Do we have a high-confidence way to reproduce the issue? Current-main source deterministically emits the unhelpful refusal when a matching restore entry exists; exact-head CI independently reproduces the stale consumer assertions after the message change. Is this the best way to solve the issue? Changing the existing refusal and documenting safe recovery is the smallest complete diagnostic fix; automatic restore recovery would expand the intentionally deferred storage contract. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9b5c4e89ca7a. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource 0, Tests +2, Docs +20. Total +22 across 3 files. Added test files: 0. View PR surface stats
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 30, 2026, 8:07 AM ET / 12:07 UTC. |
|
Merged via squash.
|
…law#188304) * fix(update): name the next step for interrupted state restores Update commands refused an interrupted shared-database publication with text that named no next action. The refusal now names the blocking .openclaw-restore-* directory, says it may hold the only copy of the original database, and links a new repair-and-recovery section: keep the directory, copy the state directory, restore a verified backup into a fresh directory, or get support. Recovery policy and read-only behavior are unchanged. * test(update): assert the interrupted restore refusal wording
What Problem This Solves
When a
.openclaw-restore-*directory sits beside the shared state database, every update command (update,update repair, rollback, finalize, unwind, and the rest) refuses with:That message names no directory and no action.
openclaw update repair --yesexited 1 in text mode with nothing to try next, and JSON mode added only a generic Doctor hint, so the operator was stuck. This dead end was found in the wave-20 update/repair QA lane.Why This Change Was Made
The refusal itself is correct and stays unchanged. An interrupted checkpoint restore moves the original database into
.openclaw-restore-<id>-<n>/displaced, so that directory may hold the only copy of the operator's state, and OpenClaw has no automatic full-state recovery for this boundary yet.docs/reference/team-immutable-update-design.mdrecords that generalizing it is gated on a storage design checkpoint. Changing recovery policy is out of scope here.What was missing was the next step.
assertUpdateRecoveryDirectoryAdmission(src/infra/update-run-recovery-admission.ts, from 000af98) now names the blocking directory, says it may hold the only copy of the original database, and links a newrepair-and-recovery#interrupted-state-restoresection. The message follows the same "preserve, then see docs" pattern asupdate-recovery-backup-status.ts. The docs give the supported path:openclaw backup restoreand activate it per Restore a full archive.Nothing suggests deleting or moving the family.
User Impact
Operators who hit this state now see which directory blocks updates, that it must be kept, and a documented way forward, instead of a bare refusal. Read-only behavior, exit codes, and recovery policy are unchanged.
Evidence
HOME/OPENCLAW_STATE_DIRwith a restore family beside the state DB:openclaw update repair --yesexits 1 and prints the new refusal with the exact path and docs link in both text and--jsonmodes; the family directory is untouched.src/cli/update-cli/update-command-run.test.ts"blocks admission when publication has no canonical DB" (displaced, replacement, both, unreadable) now asserts the path and docs anchor. All four cases fail on the previous message and pass after.update-command-run.test.ts32/32,update-command-terminal-record.test.ts26/26.#interrupted-state-restorematches the new heading;/install/backups#restore-a-full-archiveand/help/supportexist.