Repository navigation
fix(update): finish 2026.9.3 managed upgrades after migration - #148604
Conversation
Select borrowed ownership only when the captured installation key matches the candidate root. Keep existing independent admission for pnpm root replacement and package-to-Git exposure, without re-resolving the recorded key through a new symlink.
|
🦞👀 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. Reviewed September 14, 2026, 9:14 PM ET / September 15, 2026, 01:14 UTC (Revision 3). ClawSweeper reviewWhat this changesAllows managed upgrades started by OpenClaw 2026.9.3 to finish migration under the original updater’s installation lease, with shared child-process handling, regression coverage, and documentation. Merge readiness⛔ Blocked before merge - 1 item remains This remains a useful repair absent from inspected main, with no introduced blocking defect found. The updated PR body explicitly records acceptance of the previously raised published-updater qualification gap; that deferred request should not become a fresh blocker. Priority: P0 Review scores
Verification
How this fits togetherThe updater launches a candidate runtime after database migration because the installed runtime can no longer safely finish the update. Installation leases govern which processes may finalize state, restart the Gateway, and publish the terminal result. flowchart TD
A[Installed 2026.9.3 updater] --> B[Candidate finalizer]
A --> C[Live installation lease]
B --> D[Check captured identity and live parent]
C --> D
D --> E[Register child lifetime]
E --> F[Finalize and restart Gateway]
F --> G[Settle children and publish result]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +95, Tests +109, Docs +5. Total +209 across 6 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain this candidate-side repair and the recorded qualification-risk acceptance, preserving live parent authority and keeping verified migrated-state restoration a separate owner-designed capability. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the retained-parent conflict: the shipped grantless producer waits while holding the lease, and inspected main attempts independent acquisition. The PR reports failing-before/passing-after process regressions; this read-only review did not execute them. Is this the best way to solve the issue? Yes. Extending the existing executor with narrowly qualified legacy-parent admission preserves one ownership model and supports the shipped producer without changing schemas, configuration, or recovery policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against bd07ce61b906. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Merged via squash.
|
…aw#148604) * fix(update): finish 2026.9.3 managed upgrades after migration Retain the live legacy parent installation lease while the candidate finalizer adopts the handoff and settles its child commands. Preserve result publication for Git and npm updates. Reported by @jalehman (openclaw#148454). Migrated-state backup restoration remains a separate owner decision. * fix(update): preserve legacy finalization across root moves Select borrowed ownership only when the captured installation key matches the candidate root. Keep existing independent admission for pnpm root replacement and package-to-Git exposure, without re-resolving the recorded key through a new symlink.
Fixes #148454
Related: #147720, #147615.
What Problem This Solves
Managed Git and npm upgrades started by OpenClaw 2026.9.3 can stop the Gateway and then reject their own migrated finalizer with
Another update executor owns this installation, leaving noresult.jsonfor the waiting updater.User Impact
The candidate can complete same-installation migration finalization, restart verification, and result publication while its legitimate legacy parent retains the installation lease. Other or revoked owners remain excluded.
Why This Change Was Made
The shipped 2026.9.3 producer sends no executor grant and waits for the finalizer while still holding its lease. The candidate recognizes that contract from the recorded producer version, captured handoff/run metadata, unchanged canonical installation key, and private result/scratch selectors. Root moves retain their existing independent-admission path; the recorded key is never re-resolved through a newly retargeted symlink. The existing executor owner checks the matching live direct parent, pins the lease database, and registers the finalizer's own child lifetime without changing the parent's lease. Nested commands retain the existing delegation and settlement checks.
The shared child-delegation implementation moves to a focused module to keep the executor within the existing file-size limit. No configuration, schema, dependency, or recovery-policy changes are included.
Evidence
The regression drives the actual candidate worker and lease store with legacy-shaped private input and a held parent lease. Both Git and npm cases failed before the fix:
Both passed after the repair, publishing the matching terminal result, performing the synthetic native restart, and preserving the parent's exact lease. Additional cases reject wrong handoff/run/root/version/scratch/parent identity, an existing child registration, and parent ownership/database replacement before native effects.
Validation:
node scripts/run-vitest.mjs src/cli/update-cli/update-command-legacy-finalize.test.ts -t 'parent-(git|npm)$': 2 passed after 2 demonstrated pre-fix failures.pnpm build qaRuntime: passed.node scripts/run-vitest.mjs update-command-executor update-command-migrated update-command-legacy-finalize update-command-handoff update-managed-service-handoff update-command-doctor-delegation update-command-post-update: 24 files passed; 578 tests passed, 3 platform skips, before the final root-key qualifier.node scripts/run-vitest.mjs src/cli/update-cli/update-command-legacy-finalize.test.ts -t 'parent-(git|npm|pnpm-root-move|git-root-switch|wrong-root)$': 5 passed on the final qualifier. Both root-move cases first failed against the initial adapter with an admission refusal and no result file. The native receiver is staged in the synthetic candidate package so its real installation-root check stays active.node scripts/check-changed.mjsand the finalnode scripts/check-changed.mjs --staged: passed (format, production/test types, lint, and selected guards).09be149eff3fc5ee95f980f5490290f77167c546.The initial expanded run lacked checkout
distworkers, producing missing-runtime failures and a helper wait timeout; it was cancelled before building the normal CI runtime prerequisite and rerunning. This is synthetic process/lease/native-command boundary proof, not a full published-updater or real systemd deployment test. The full published-updater matrix was excluded by the campaign's host constraints. ClawSweeper's exact-head review found no introduced correctness or security defects and retains published-updater qualification as a pre-merge compatibility risk.Follow-up (owner decision)
Restoring migrated state and restarting the retained version after finalization fails remain outside this PR. The shipped v2026.9.3 rollback owner refuses migrated-state rollback, and its managed helper requires verified restoration facts before restart (lines 1706–1730). A failure result alone cannot establish those facts. Peter must decide the design and authorization for verified backup restoration; this repair makes the reported successful update path complete and does not claim new failure-recovery or legacy crash-survival guarantees.
Reported by @jalehman (#148454).
ClawSweeper review
The completed review of
09be149eff3fc5ee95f980f5490290f77167c546found no introduced correctness or security defects. No code fixups were needed. The P1 compatibility-risk item and P2 request for a full published-2026.9.3 retained-parent qualification run are deferred under the maintainer's explicit land-as-is decision: the source contract, passing process/lease boundary regressions, and exact-head CI support this repair, while full published-updater qualification remains a documented gap. Failed-finalization recovery remains the separate owner decision described above.