Skip to content

fix(update): finish 2026.9.3 managed upgrades after migration - #148604

Merged
steipete merged 2 commits into
mainfrom
steipete/upd-migrated-finalize-legacy-parent-lease
Sep 15, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/upd-migrated-finalize-legacy-parent-lease

Conversation

@steipete

@steipete steipete commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

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 no result.json for 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:

Another update executor owns this installation.
result.json exists: false: expected 1 to be +0
Tests 2 failed

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.mjs and the final node scripts/check-changed.mjs --staged: passed (format, production/test types, lint, and selected guards).
  • Isolated Codex autoreview at P1: scoped-clean; no actionable P0/P1 findings.
  • GitHub CI run 34908308067: completed successfully for 09be149eff3fc5ee95f980f5490290f77167c546.

The initial expanded run lacked checkout dist workers, 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 09be149eff3fc5ee95f980f5490290f77167c546 found 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.

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 (#148454).

Migrated-state backup restoration remains a separate owner decision.
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.
@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation cli CLI command changes size: L maintainer Maintainer-authored PR labels Sep 14, 2026
@steipete
steipete marked this pull request as ready for review September 14, 2026 23:19
@clawsweeper clawsweeper Bot added P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 14, 2026
@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 14, 2026, 9:14 PM ET / September 15, 2026, 01:14 UTC (Revision 3).

ClawSweeper review

What this changes

Allows 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
Reviewed head: 09be149eff3fc5ee95f980f5490290f77167c546

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with meaningful process-boundary proof and no blocking finding; the broader deployment qualification gap has an explicit disposition.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): Reported after-fix runs exercise the actual candidate worker, lease store, native receiver, and process-execution owner: legitimate Git/npm continuations publish matching results, while wrong or revoked authority prevents the native effect. Fixture service readiness does not prove a complete published upgrade; that separate qualification gap is explicitly accepted in the updated body.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): Reported after-fix runs exercise the actual candidate worker, lease store, native receiver, and process-execution owner: legitimate Git/npm continuations publish matching results, while wrong or revoked authority prevents the native effect. Fixture service readiness does not prove a complete published upgrade; that separate qualification gap is explicitly accepted in the updated body.
Evidence reviewed 9 items Introduced change and checkout identity: Inspected the merge-base-to-head changes and complete changed production modules. The new child-owner module extracts the existing implementation; the behavioral additions concern legacy-parent admission and lifetime registration. The host identifies the same six paths in the verified test merge. Working-tree status remained clean.
Published producer contract: The v2026.9.3 producer sends grantless private input, preserves the captured environment, overrides all three temporary-directory selectors, and waits for result.json. The tag resolves to commit 1391f7c. These are existing shipped selectors that the candidate adapter recognizes.
Live authority and settlement: Legacy admission requires matching run, installation key, handoff owner, version-2 update lease, live helper and direct-parent process identities, and no unsettled children. Subsequent assertions recheck the parent and finalizer leases through a pinned database; cleanup releases the finalizer lifetime without releasing the borrowed parent.
Findings None None.
Security None None.

How this fits together

The 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]
Loading

Before merge

  • Resolve merge risk (P1) - Full published-2026.9.3 qualification with migrated operator state remains unperformed: a deployment-specific selector or parent-process mismatch could still leave the Gateway stopped. The updated PR body explicitly accepts this compatibility gap.
Agent review details

Security

None.

PR surface

Source +95, Tests +109, Docs +5. Total +209 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 4 334 239 +95
Tests 1 131 22 +109
Docs 1 5 0 +5
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 470 261 +209

Review metrics

Metric Value Why it matters
Net implementation growth production +95 lines; tests +109 lines Production growth implements the shipped-parent adapter; moving the existing child owner accounts for much of the apparent diff without creating a second implementation.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #148454
Summary: This PR addresses the canonical retained-parent finalization failure; the merged Doctor repairs concern adjacent execution paths.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Honor the recorded qualification exception (recommended)
    Proceed under the documented land-as-is decision while retaining the published-updater qualification gap in the PR evidence.
  2. Qualify the complete published upgrade
    If the owner revisits the exception, require the published 2026.9.3 updater to complete retained-parent finalization and Gateway readiness against the candidate.

Technical review

Best 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.

Labels

Label justifications:

  • P0: The linked report establishes a Control UI update that leaves the Gateway stopped with no in-product recovery path.
  • merge-risk: 🚨 compatibility: The adapter must interoperate with an already-installed 2026.9.3 updater, while full published-driver qualification remains an explicitly accepted gap.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): Reported after-fix runs exercise the actual candidate worker, lease store, native receiver, and process-execution owner: legitimate Git/npm continuations publish matching results, while wrong or revoked authority prevents the native effect. Fixture service readiness does not prove a complete published upgrade; that separate qualification gap is explicitly accepted in the updated body.
  • proof: sufficient: Contributor real behavior proof is sufficient. Reported after-fix runs exercise the actual candidate worker, lease store, native receiver, and process-execution owner: legitimate Git/npm continuations publish matching results, while wrong or revoked authority prevents the native effect. Fixture service readiness does not prove a complete published upgrade; that separate qualification gap is explicitly accepted in the updated body.

Evidence

What I checked:

  • Introduced change and checkout identity: Inspected the merge-base-to-head changes and complete changed production modules. The new child-owner module extracts the existing implementation; the behavioral additions concern legacy-parent admission and lifetime registration. The host identifies the same six paths in the verified test merge. Working-tree status remained clean. (src/cli/update-cli/update-command-executor.ts:279, 09be149eff3f)
  • Published producer contract: The v2026.9.3 producer sends grantless private input, preserves the captured environment, overrides all three temporary-directory selectors, and waits for result.json. The tag resolves to commit 1391f7c. These are existing shipped selectors that the candidate adapter recognizes. (src/cli/update-cli/update-command-migrated.ts:149, 1391f7cd2d40)
  • Live authority and settlement: Legacy admission requires matching run, installation key, handoff owner, version-2 update lease, live helper and direct-parent process identities, and no unsettled children. Subsequent assertions recheck the parent and finalizer leases through a pinned database; cleanup releases the finalizer lifetime without releasing the borrowed parent. (src/cli/update-cli/update-command-executor.ts:397, 09be149eff3f)
  • Production-boundary proof and its limits: The inspected regression launches the actual finalizer, lease store, native receiver, and exec-file boundary. Success checks matching terminal output, native effect, preserved parent ownership, and settled descendants; denial cases check wrong identities, existing children, ownership revocation, and database replacement before native effects. The captured PR body reports pre-fix failures and after-fix passes. Service discovery, plugin work, and readiness are fixtures, so this does not establish a full published-updater or systemd deployment. (src/cli/update-cli/update-command-legacy-finalize.test.ts:354, 09be149eff3f)
  • Previous review disposition: The supplied completed review has no findings and requests published-2026.9.3 retained-parent qualification. The captured body explicitly defers that request under the maintainer’s land-as-is decision and keeps failed-finalization restoration outside this repair. A read-only REST check returned the same head and disposition; no new code change requires reopening that accepted tradeoff. (09be149eff3f)
  • Current-main necessity and release check: At fetched main, grantless finalization still independently enters the executor without the legacy-parent adapter. The latest release’s worker also lacks this repair. The merged related Doctor repairs address different admission paths and do not supersede the retained-parent fix. (src/infra/update-migrated-finalize.worker.ts:114, bd07ce61b906)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-14T23:28:10.439Z sha 09be149 :: blocked before merge. :: none
  • reviewed 2026-09-14T23:48:27.848Z sha 09be149 :: blocked before merge. :: none

@steipete
steipete merged commit 18b6187 into main Sep 15, 2026
277 checks passed
@steipete
steipete deleted the steipete/upd-migrated-finalize-legacy-parent-lease branch September 15, 2026 01:16
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 15, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes docs Improvements or additions to documentation maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Managed upgrade self-conflicts when legacy parent retains lease during migrated finalization

1 participant