Repository navigation
Conversation
Let repair bypass custody grace for positively dead owners while preserving descendant checks. Restore gateways stopped by interrupted managed updates, retain startup evidence across readiness failures, and preserve later operator stops. Refs #164800.
|
🦞👀 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: blocked before merge. What this changesThe PR removes unnecessary recovery grace for proven-dead update owners and restores Gateways stopped by interrupted updates after successful repair. Example: A Linux systemd managed update is killed after stopping the Gateway, and both update owners are confirmed dead.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness⛔ Blocked before merge - 2 items remain Keep open: this maintainer-authored PR addresses a verified recovery outage, but its startup evidence can be silently dropped, allowing a later repair to restart an intentionally stopped Gateway. Priority: P0 Before merge
Findings
Tests
Agent review detailsHow this fits togetherUpdate repair reads persisted update history and process custody, runs Doctor and plugin finalization, and uses the existing installation executor and native service owners to restore and verify the Gateway. flowchart TD
A[Update repair CLI] --> B[Process and custody checks]
B --> C[Doctor and plugin finalization]
C --> D[Update history stop decision]
D --> E[Installation and native service owners]
E --> F[Gateway readiness verification]
F --> G[History and repair outcome]
Technical reviewBest possible solution: Keep explicit repair as the recovery owner, persist startup receipts reliably, verify native readiness, and make recovery accessible through a visible command launcher. Do we have a high-confidence way to reproduce the issue? The linked maintainer reproduction and current-main grace/finalization paths establish the recovery failure; this read-only review executed no target code and does not establish the original activation-stall trigger. Is this the best way to solve the issue? Explicit repair is a justified recovery owner and reuses existing custody, service selection, and readiness machinery, but restart decisions must not depend on a history write that can silently fail. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2e628e80c294. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceAcceptance criteria:
What I checked:
Likely related people:
PR surfaceSource +276, Tests +314, Docs +27. Total +617 across 12 files. Added test files: 1. View PR surface stats
LabelsLabel changes: No label 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 27, 2026, 5:46 PM ET / 21:46 UTC. |
|
Superseded by #188497, which consolidates this draft and its sibling onto current main and adds the live Crabbox proof. |
What Problem This Solves
openclaw update repaircan wait 45 minutes after both managed-update owners have died, then finish successfully while leaving the Gateway that the interrupted update stopped offline.Refs #164800 (repair backstop, items 3 and 4).
User Impact
Repair can reclaim a handoff immediately when every recorded owner is positively dead. After successful finalization, it starts and verifies the managed Gateway only when the recovered update recorded stopping it without a later successful start. Operator-stopped Gateways stay stopped; named data risks, lost ownership, and live or unverified descendants still prevent unsafe recovery.
Why This Change Was Made
The grace check in
src/infra/update-managed-service-handoff-cleanup.ts:93used elapsed time even after reclamation had established owner death. It now distinguishes positively dead owners from unknown custody while retaining the descendant census and transactional ownership checks. The separate reboot flag retains its existing census meaning.Standalone finalization previously always returned
restart: false(src/cli/update-cli/update-command-finalize.ts:526on the base). Repair now consumes the existingservice-stopstep and restart/verification facts, finalizes first, then restores through the existing installation executor, native service lock/start, and readiness machinery. It records health in both the recovered run and repair run and reports the result in human and JSON output. Failures direct operators toopenclaw gateway status --deep.No new stop-time fact or schema is needed. Repair records completed
service-startorservice-runningsteps in the active repair run before awaiting readiness. These retained facts survive thrown errors and later stopped health snapshots; ordinary step writes cannot mutate terminal original runs. Later repair retries readiness on a running service and leaves a subsequently stopped Gateway stopped. A blanket restart of every stopped service was rejected because it would override operator intent. Treating positively dead parents as the reboot flag was rejected because that would weaken descendant inspection. Keeping the grace for proven-dead owners would preserve the original outage.Evidence
node scripts/run-vitest.mjswith--maxWorkers=1.node scripts/run-tsgo.mjspassed fortsconfig.core.jsonandtest/tsconfig/tsconfig.core.test.cli-update.json. Targetedoxlint,oxfmt --check, docs MDX sanity, andgit diff --checkpassed.The CLI regressions invoke registered repair, real finalization, and the SQLite ledger, with synthetic host service/readiness responses and the existing Doctor/plugin fixture. The live Linux/systemd SIGKILL reproduction has not been rerun here; combined-lane validation remains necessary.
Final isolated Codex autoreview: scoped-clean, no actionable P0–P2 findings. Accepted review findings about readiness retries, thrown probes, and overwritten liveness evidence were fixed and covered by repair-boundary tests. Startup evidence is retained in the active repair run rather than attempting to append ordinary steps to a terminal original run.
Diff against the base: production +283/-7 (net +276), tests/harness +339/-25 (net +314), docs +38/-11 (net +27). The production growth is the missing restart orchestration; it reuses existing ownership, service, readiness, and ledger owners rather than adding a persistence mechanism. The simplification pass kept one history-based restoration decision, reused the existing fences, and replaced the obsolete grace expectations.