Repository navigation
fix(update): keep retained service authority after a stopped-free inspection and let repair retire untouched preparations - #164997
Conversation
Retain the admitted executor and systemd manager identity during post-stop revalidation. Allow explicit repair to retire verified preparations that never published through the existing publication owner. Refs #164459
|
🦞👀 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: needs maintainer review before merge. Reviewed October 4, 2026, 12:02 PM ET / 16:02 UTC. ClawSweeper reviewWhat this changesThe PR preserves update ownership when inspecting a stopped systemd service and lets explicit repair retire verified package preparations that never published. Merge readiness✅ Ready for maintainer review This PR addresses two concrete recovery gaps still present on current main. No blocking introduced defect was found; the reporter’s original inspection refusal remains separate unresolved work. Priority: P1 Review scores
Verification
How this fits togetherOpenClaw’s updater checks the installed package, databases, and managed Gateway before activation. Its recovery owners use retained service identity and package-publication records to restore service or safely clear unfinished preparation. flowchart TD
A[Update or repair request] --> B[Current executor ownership]
B --> C[Service and package inspection]
C --> D[Retained systemd manager identity]
D --> E[Activation or Gateway recovery]
C --> F[Untouched package preparation]
F --> G[Verified artifact retirement]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +60, Tests +199, Docs +16. Total +275 across 10 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep recovery with the existing service and publication owners, preserving live authority checks and the original installed package during preparation retirement. Do we have a high-confidence way to reproduce the issue? Yes, for the two narrowed source-level defects: post-stop inspection drops the retained executor context, and repair refuses untouched preparation. The reporter’s original native inspection failure is not independently reproduced. Is this the best way to solve the issue? Yes. The patch routes retained authority and retirement through existing owners without adding competing recovery policy, configuration, or publication machinery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 29c36b7ace8a. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
…pection and let repair retire untouched preparations (openclaw#164997) Refs openclaw#164459
Backport all required recovery fixes to 2026.10.1: #167302, #167330, #167358, and #167377. Include their missing settlement prerequisites #164997, #165238, and #165607. Close obsolete recovery custody durably before best-effort evidence archival; keep unfinished rollback and current mutation authority strict. Completed history cannot block subsequent updates. Qualify authentic interruptions from pinned 9.8/9.9 updaters plus the unchanged 9.7-to-9.8 negative control. Adapt donor APIs to the release-owned publication and lease database owners. No version, dependency, budget, permission, or publication changes. Proof:619 focused tests passed, including14 release-profile cases; fresh complete69-file P0-P2 review clean. Complete changed gate passed. Exact combined release build and stable/all/soak qualification remain pending. Sources: 3ed1e21 (#167302) 4821885 (#167330) 8879e5e (#167358) bc860ad (#167377) 9497527 (#164997) 5ae6497 (#165238) fb84dd5 (#165607) Co-authored-by: Scott Hanselman <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
Refs #164459
What Problem This Solves
Fixes updates losing retained systemd service authority after stopping the Gateway, and repair rejecting an untouched package preparation left by a pre-publication refusal.
User Impact
A previously running Gateway retains its recovery path after a refusal that changed nothing.
openclaw update repaircan retire a preparation that never published, leaving the original package and launchers unchanged and clearing the next update's pending-package gate. An already stopped service stays stopped. An older running updater cannot acquire this fix before publication; use a CLI containing the fix to repair retained preparation.Why This Change Was Made
Systemd may collect an inactive unit. Post-stop schema revalidation now carries the original executor and manager identity into the existing metadata-loading owner instead of treating that collection as lost service authority. Package repair uses the existing publication owner under fresh executor authority to verify, abort, and retire untouched preparation; changed launchers, foreign generations, and active owners remain protected. Existing plugin preflight moved into candidate validation to meet the execution module's line cap without changing its lazy loading or admission rechecks.
Thanks @jorden2895 for the report and retained diagnostics.
Evidence
prepared/abortedpackage operations that never published, including the shipped legacy launcher-group descriptor. Package/launcher identity and content remain unchanged, and the pending-package admission check clears. Replaced launchers and active owners remain refused.service-ownership-unverifiedneeds the original stderr diagnostic. The collected-unit regression establishes one concrete inspection failure path; the post-installer service definition does not prove the original cause. This PR references the issue rather than closing it.pnpm test src/cli/update-cli/update-command-execution.test.ts --maxWorkers=1: 75 passed, three runs, 21.01–21.42 s wrapper wall time and approximately 4.9–5.0 s test time per run.pnpm test src/cli/update-cli/update-repair-package-activation.test.ts --maxWorkers=1: 11 passed, three runs, 17.72–17.97 s wrapper wall time and approximately 1.6–1.7 s test time per run. PR CI seconds are not yet available.src/cli/update-cli/update-command-original-service.test.tsrecorded 167.434 s across 50 completed passing cases;src/cli/update-cli.windows-lifecycle.test.tsrecorded 167.099 s across 11 completed passing cases. These pre-existing fixture costs include repeated real schema/state-worker launches inside cases, rather than shared compiler preparation. Profile and share suitable process fixtures while preserving the cross-process recovery contracts; the lane's slow-test gate is explicitly waived for these files.node scripts/check-changed.mjs: passed (exit 0), including core types, all 27 test type graphs, unused-export scans, lint, and the remaining source guards. The fixture drain signature was corrected after the first typecheck found its missing guard argument; no production change was needed.For (a), please paste the complete stderr from the original failed
openclaw updaterun and the output ofcat ~/.openclaw/logs/gateway-restart.log, including anyFailed to restart managed gateway service after failed update:line, with secrets and private paths redacted as needed.