Repository navigation
fix(update): reconcile orphaned update runs automatically - #143774
Conversation
|
🦞👀 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 September 10, 2026, 6:30 AM ET / 10:30 UTC (Revision 9). ClawSweeper reviewWhat this changesAutomatically retire untouched legacy update records after 24 hours, retain recovery guidance, and refresh Gateway status before refusing suspended Control UI configuration writes. Merge readiness✅ Ready for maintainer review This PR remains necessary: current main and v2026.9.3 do not automatically expire the reported identityless orphan. The previous history-read findings are resolved, retained-state proof supports the fix, and no blocking patch defect remains. Priority: P0 Review scores
Verification
How this fits togetherThe update ledger records installation progress in SQLite and feeds CLI status and the Control UI. Its recovery classification determines whether the UI continues suspending configuration writes. flowchart TD
A[Stored update history] --> B[Ledger recovery owner]
C[Startup and status requests] --> B
B --> D{Expired untouched orphan?}
D -->|Yes| E[Retained abandoned outcome]
D -->|No| F[Preserve live or protected history]
E --> G[Status guidance and UI write refresh]
F --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +263, Tests +469, Docs +24. Total +756 across 29 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. Technical reviewBest possible solution: Keep automatic recovery within the ledger owner so expired orphan history releases settings without weakening live-driver or retained-recovery protection. Do we have a high-confidence way to reproduce the issue? Yes, from source: an untouched identityless running row remains active under main's automatic classifier and suspends UI writes. Supplied installed-baseline evidence demonstrates that failure; this read-only review did not execute it. Is this the best way to solve the issue? Yes. The accepted bounded expiry reuses the existing ledger transaction and UI write coordinator, preserves recovery exclusions, and has retained-state upgrade evidence. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3b615161878f. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (8 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
332c389 to
15c523b
Compare
Expire untouched identityless requested admissions after 24 hours through the ledger owner, preserve recovery exclusions, and refresh Control UI write admission from authoritative update state. Retain the legacy expiry advisory in status and failure reports. Fixes #139714
15c523b to
8f7c4ad
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
…43774) * fix(update): reconcile orphaned update runs automatically Expire untouched identityless requested admissions after 24 hours through the ledger owner, preserve recovery exclusions, and refresh Control UI write admission from authoritative update state. Retain the legacy expiry advisory in status and failure reports. Fixes openclaw#139714 * fix(status): omit empty update history metadata * fix(update): preserve asynchronous history reads * fix(update): preserve readable history during reconciliation * test(update): preserve expiry and supersession precedence
Fixes #139714
Refs #143136
Refs #143859
Additional instructions
This branch is in the upstream repository and is editable by maintainers.
What Problem This Solves
Fixes an issue where users with an untouched, identityless 2026.9.2-era update admission would keep seeing an update in progress and lose Control UI configuration-write access indefinitely, even after the updater was gone. The affected user need not start another update to recover.
Why This Change Was Made
Peter's 2026-09-10 contract is: “update should always work, best effort, never worse than before.” The approved bounded expiry applies only to a running/requested identityless admission older than 24 hours, with creation equal to last update, no finish timestamp, and only its original in-progress step. The ledger records
failed/legacy-driver-expiredwith an abandonment step and retry advisory. Startup and status reads use the same owner; retained recovery, live/inconclusive drivers, and younger or progressed identityless records keep their protections. Existing #143136 dead-driver rules and the 30-minute inactivity window remain unchanged.A new explicit update is a different scenario: existing admission logic may first terminalize the old row as
failed/superseded. That is preserved and is not mislabeled as expiry. Either terminal state releases the Control UI write interlock. The browser refreshes authoritative status before refusing a suspended mutation and rechecks the connection before dispatch.Best-effort reconciliation checks eligibility read-only before requesting write access. Gateway cold snapshots remain asynchronous, and write refusal is reported separately while retaining readable history. No configuration option, dependency, SQLite schema, protocol bump, or retention deletion is added.
User Impact
Operators regain settings writes automatically through startup/status reconciliation, with this advisory when the bounded expiry applies: “A 2026.9.2-era update never progressed past admission; treated as abandoned after 24 h; run
openclaw updateto retry.” Starting a new update also leaves the old admission terminal, using its existing supersession semantics.Release-note context: expire untouched legacy update admissions after 24 hours, preserve explicit-update supersession, and release stale Control UI configuration-write suspension.
Evidence
Live retained-state proof
All cells ran in isolated Linux arm64 containers with Node 24.19.0, published baselines, real Gateway processes, authenticated browser/RPC flows, and a synthetic model endpoint. Each seeded the same identityless
requested/runningshape, 25 hours old and unmodified since creation.failed/legacy-driver-expired; advisory in both status commands; admission IDs unchangedfailed/superseded; no active run and no false expiry advisoryfailed/legacy-driver-expired; advisory and no active runPhase A first proved the shipped defect: status retained the running row, the editor and Save were disabled, and no
config.setwas submitted. It then invoked candidateupdate statusandstatusagainst that state while the published Gateway continued serving. The same settings save succeeded and persisted. Fixture history was initialized before seeding; no update was invoked after the aged row was seeded. Phase B exercised the actual update and retained-state checks. The sibling ran once. Cleanup shutdown is excluded from the one-second health samples. The updaters' own recorded downtimes were 38.643 s and 64.847 s respectively.Live artifacts were built from
15c523bd0877bb49b63884aee2629780bc7d3229. Normal candidate SHA-256:9591bd253b8b35bbfa7f75a9eda75dfef5bdd5d0573e57f73f8021b2a0ac2cf6. The 9.3 cell used the maintained first-hop version fixture (7213e1b612d12a8b4619ddb5c3f113d7bdc0cd50d9f0a878577d28acc9fae51b); its audited changes are onlypackage.jsonanddist/build-info.json. Runtime/UI bytes are unchanged. Phase A and the 9.2 sibling used the normal candidate.Inspected synthetic browser evidence
Running orphan on shipped 9.3:
Disabled write controls:
Persisted settings after a successful candidate
config.set:Tests and final rebase
The four implementation commits initially rebased patch-identically from reviewed head
332c38995cb; the added commit is test-only. It verifies reconciliation-first versus admission-first precedence, preserves terminal reasons, and exercises the real overlay/interlock for both terminal outcomes and protected running rows. The focused suites passed 96 tests, the test-file changed gate passed, and the full build/package checks passed.Main moved during live proof. The final rebase onto
cbc245824eb821a4f7ad1bc68cad5d143674f84crequired one import-only resolution inupdate-run-report.ts, preserving both the legacy advisory imports and main's warning helpers from #143767. No further feature behavior changed. The live cells were not rerun after that final rebase; their artifact SHA remains explicit above. Report and precedence suites passed 116 tests after the rebase. The changed-file gate for the resolved report and three test files, plusgit diff --check, passed:Earlier regression proof on
46cbea5ademonstrated four protected-row write-admission failures, three CLI history-loss failures, two Gateway ownership exceptions, and two cold-snapshot responsiveness failures. Those regressions passed after the owner repair. The final precedence tests document the already-correct supersession behavior rather than changing it.Final head:
8f7c4ad874c1c5a4833c0896759507eafc77ef01. Exact-head CI run 34464230234 completed successfully.node scripts/watch-pr-ci.mjs 143774 8f7c4ad874c1c5a4833c0896759507eafc77ef01finished GREEN with zero pending checks and 12 superseded checks; GitHub's raw rollup still reported FAILURE. The PR remains unmerged; the lead owns landing.