Skip to content

fix(update): reconcile completed updates after interrupted verification - #152202

Merged
steipete merged 3 commits into
mainfrom
upd/update-run-interruption-settlement
Sep 18, 2026
Merged

steipete merged 3 commits into
mainfrom
upd/update-run-interruption-settlement

Conversation

@steipete

@steipete steipete commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes a completed update later appearing as OpenClaw update failed: abandoned when the updater is interrupted while verifying the restarted Gateway, as reported on Discord.

User Impact

The Gateway and Doctor can record a truthful successful outcome after the updater exits, with a warning explaining the interruption. Doctor explains older abandoned runs whose recorded evidence cannot prove completion. Log-follow transport retry is handled separately in #152152.

Why This Change Was Made

The installed updater can disappear after activation without recording the target build or final health result. The candidate now records its exact installed build identity before returning post-core completion. One ledger owner verifies the installed and serving target through the existing restart-health checks before atomically settling the latest interrupted run.

Live or unobservable drivers, newer runs, recovery work, and recorded repair, acknowledgement, failure, or rollback evidence prevent correction. The transaction rechecks the row after probing. Untouched legacy admissions retain their synchronous startup expiry. Existing steps carry the identity: no schema, run-state, option, environment variable, or dependency change is needed, and the released rollback interpretation of an empty after.version is preserved.

Evidence

Published 2026.9.4 updater → candidate, private npm prefixes and isolated state, real systemd user services. Each signal was injected at running/verifying, after the Gateway PID changed and before confirmation:

Interruption Unpatched result after 30 minutes Final-head result Settlement after signal
SIGINT (CLI exit 130) failed / abandoned succeeded, reason null 10.701 seconds
SIGHUP (CLI exit 1) failed / abandoned succeeded, reason null 11.835 seconds

Installed and serving builds matched the respective target in all four cells. Both final-head rows contain the target receipt, full readiness facts, and an interruption warning; both status rows read ✅ OpenClaw updated to 2026.9.4 (from 2026.9.4). No probe edited timestamps, outcomes, or published binaries. Baseline Testbox · Final-head Testbox. All task-owned Testboxes are stopped.

The full package build and both live cells tested exact head 6d8d60518013bbaba38fa1d6a1fce89416c2f725, verified source tree ff487dae4f6ad5822407c41c8333c48aa59a5219. Installed/serving build: 2026.9.4-21b42634966a-2026-09-18T22-42-06.840Z.

  • Regressions failed before their fixes. 135 unique focused tests passed, including interrupted completion, legacy startup/RPC expiry, missing identity, driver protection, recovery/rollback, later repair, races, shutdown, and real post-core resume.
  • Final node scripts/check-changed.mjs passed in full, including production/test typechecks, lint, dead exports, schema/import-cycle guards, and the remaining guards. No suppressions, baseline edits, or extension-lint substitution were needed.
  • Fresh committed-branch P1 autoreview of the exact head: scoped-clean.

Exact-head CI is green: run 35402621904, attempt 2, completed successfully with 142 successful checks, 15 skipped, 0 failing, and 0 pending in the CI run. REST verified head 6d8d60518013bbaba38fa1d6a1fce89416c2f725. One failed-jobs infrastructure rerun recovered the runner shutdown; no source changes were needed.

Production LOC: +385/−24. Tests: +313/−14. Documentation: +30/−3.

@clawsweeper

clawsweeper Bot commented Sep 18, 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 gateway Gateway runtime cli CLI command changes commands Command implementations size: L maintainer Maintainer-authored PR labels Sep 18, 2026
@steipete
steipete marked this pull request as ready for review September 18, 2026 22:26
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 18, 2026
@clawsweeper

clawsweeper Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 18, 2026, 7:22 PM ET / 23:22 UTC (Revision 4).

ClawSweeper review

What this changes

Records the installed build before update handoff and lets Gateway monitoring or Doctor verify and correct completion history when the updater exits during restart verification.

Merge readiness

⛔ Blocked before merge - 1 item remains

The fix remains useful and has no blocking findings. The supplied published-updater runs resolve the previous upgrade-proof concern; current main still lacks this reconciliation.

Priority: P2
Reviewed head: 6d8d60518013bbaba38fa1d6a1fce89416c2f725

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, guarded repair with convincing published-driver proof and no blocking correctness findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The supplied exact-head systemd runs exercise the published 2026.9.4 updater, candidate receipt writer, and Gateway reconciliation after SIGINT and SIGHUP during verification. Both settle succeeded with matching installed/serving builds and readiness facts, satisfying the earlier upgrade-proof request.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The supplied exact-head systemd runs exercise the published 2026.9.4 updater, candidate receipt writer, and Gateway reconciliation after SIGINT and SIGHUP during verification. Both settle succeeded with matching installed/serving builds and readiness facts, satisfying the earlier upgrade-proof request.
Evidence reviewed 8 items Shared settlement owner and guarded commit: Reconciliation requires the latest run, positively dead recorded drivers, completed post-update and restart steps, and an exact candidate receipt. It rejects repair, rollback, acknowledgement, and recovery evidence, then rechecks the complete row and eligibility inside the write transaction after health probing.
Fresh health and generation checks: The observer reuses existing restart-health checks, requires matching installed and serving version/build identities, checks HTTP readiness, compares successive Gateway generations, and checks installed identity again before returning verification facts.
Published-driver upgrade proof resolves earlier concern: The captured PR body records published 2026.9.4 updater runs against isolated npm prefixes and real systemd user services. SIGINT and SIGHUP during verifying produced failed/abandoned baseline outcomes; the exact reviewed head settled succeeded with matching installed/serving builds, readiness facts, and interruption warnings after 10.701 and 11.835 seconds. The linked Testbox is https://github.com/openclaw/openclaw/actions/runs/35402384156. Its workflow was cancelled after use; workflow conclusion alone is not the behavioral proof, which is the supplied run observations.
Findings None None.
Security None None.

How this fits together

OpenClaw’s update ledger records installation progress and outcomes for CLI, Doctor, and Gateway clients. This change combines the candidate’s recorded build identity with fresh service health observations before updating that history.

flowchart TD
  A[Installed updater] --> B[Candidate finishes post-core work]
  B --> C[Record candidate build in update history]
  C --> D[Gateway watcher or Doctor]
  D --> E{Drivers dead and recovery guards clear?}
  E -->|Yes| F[Verify installed and serving build health]
  F --> G[Recheck ledger and record success]
  E -->|No| H[Preserve existing outcome]
Loading

Before merge

  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +361, Tests +299, Docs +27. Total +687 across 12 files.

View PR surface stats
Area Files Added Removed Net
Source 6 385 24 +361
Tests 4 313 14 +299
Docs 2 30 3 +27
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 12 728 41 +687

Review metrics

Metric Value Why it matters
Published-updater interruption proof 2 baseline and 2 candidate cells Both SIGINT and SIGHUP exercise the released updater crossing into the candidate and demonstrate corrected completion history.
Persistent contract 1 candidate-identity step; 0 schema migrations The receipt uses existing ledger fields while preserving the released rollback reader’s interpretation of after.version.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/commands/doctor-update-run.ts, unknown-data-model-change: src/commands/doctor-update-run.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Keep completion recovery in the shared ledger owner, using exact build and fresh health evidence while preserving genuinely failed or unverifiable history.

Do we have a high-confidence way to reproduce the issue?

Yes: interrupt the updater during verification after the Gateway PID changes. The supplied baseline runs demonstrate the false abandoned outcome, and current-main source retains that mechanism; this review did not execute it.

Is this the best way to solve the issue?

Yes: one shared reconciliation operation reuses existing health checks and storage fields, with fresh transactional guards instead of treating version equality alone as success.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 07cd92b5772b.

Labels

Label justifications:

  • P2: This repairs misleading update-failure history after a successful installation, with a bounded recovery scope.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The supplied exact-head systemd runs exercise the published 2026.9.4 updater, candidate receipt writer, and Gateway reconciliation after SIGINT and SIGHUP during verification. Both settle succeeded with matching installed/serving builds and readiness facts, satisfying the earlier upgrade-proof request.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied exact-head systemd runs exercise the published 2026.9.4 updater, candidate receipt writer, and Gateway reconciliation after SIGINT and SIGHUP during verification. Both settle succeeded with matching installed/serving builds and readiness facts, satisfying the earlier upgrade-proof request.

Evidence

What I checked:

  • Shared settlement owner and guarded commit: Reconciliation requires the latest run, positively dead recorded drivers, completed post-update and restart steps, and an exact candidate receipt. It rejects repair, rollback, acknowledgement, and recovery evidence, then rechecks the complete row and eligibility inside the write transaction after health probing. (src/infra/update-run-interruption.ts:88, 6d8d60518013)
  • Fresh health and generation checks: The observer reuses existing restart-health checks, requires matching installed and serving version/build identities, checks HTTP readiness, compares successive Gateway generations, and checks installed identity again before returning verification facts. (src/infra/update-run-interruption-health.ts:18, 6d8d60518013)
  • Published-driver upgrade proof resolves earlier concern: The captured PR body records published 2026.9.4 updater runs against isolated npm prefixes and real systemd user services. SIGINT and SIGHUP during verifying produced failed/abandoned baseline outcomes; the exact reviewed head settled succeeded with matching installed/serving builds, readiness facts, and interruption warnings after 10.701 and 11.835 seconds. The linked Testbox is https://github.com/openclaw/openclaw/actions/runs/35402384156. Its workflow was cancelled after use; workflow conclusion alone is not the behavioral proof, which is the supplied run observations. (6d8d60518013)
  • Released rollback interpretation remains intact: The v2026.9.4 Gateway uses an empty after.version when recognizing restored-generation verification. The patch stores candidate identity in an existing step and leaves after.version empty until successful serving verification; it adds no schema migration. (src/gateway/server-restart-update-run.ts:47, 3a9d69db306c)
  • Current-main necessity: The fetched main watcher still invokes abandoned-run reconciliation without the new interrupted-success observer. The release ledger likewise finishes eligible abandoned runs as failed; no verified merged replacement was established. (src/gateway/update-run-watcher.ts:63, 07cd92b5772b)
  • Boundary regression coverage: Inspected tests cover live and unknown drivers, retained previous drivers, mismatched builds, recovery and rollback, later repair, changed latest-run identity, shutdown, read-only Doctor, and receipt persistence before publishing the post-core result. Tests were reviewed, not executed in this read-only checkout. (src/gateway/update-run-watcher.interruption.test.ts:148, 6d8d60518013)

Likely related people:

  • 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 (3 earlier review cycles)
  • reviewed 2026-09-18T22:33:19.416Z sha 4637358 :: blocked before merge. :: none
  • reviewed 2026-09-18T22:48:35.388Z sha 6d8d605 :: blocked before merge. :: none
  • reviewed 2026-09-18T23:02:30.758Z sha 6d8d605 :: blocked before merge. :: none

@steipete
steipete merged commit 119f485 into main Sep 18, 2026
388 of 391 checks passed
@steipete
steipete deleted the upd/update-run-interruption-settlement branch September 18, 2026 23:24
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 18, 2026
…rent-main-20260918

* origin/main: (1925 commits)
  fix(ui): preserve person picker selection and profile photos (#152194)
  feat(meetings): summarize meetings during live capture (#151957)
  refactor(watch): share delivery status text formatting (#152228)
  fix(skills): detach idle reviews from foreground plugin scope (#152235)
  fix(mcp): stop cancelled question tests leaking into later cases (#152215)
  fix: show pasted text as compact chat chips (#151618)
  refactor(config): share diagnostic container scanning (#149099)
  fix(whatsapp): admit debounce candidates independently (#112001)
  fix(release): qualify 2026.7.34 frozen SDK (#152230)
  fix(sessions): notify Home about new sessions by default (#152068)
  fix(ui): open workspace links with spaces and emoji (#152179)
  fix(update): reconcile completed updates after interrupted verification (#152202)
  fix: reduce repeated update validation for large agent fleets (#151678)
  docs: clarify WebChat commentary attachment compatibility (#152225)
  fix(worktrees): keep provisioning inspection under the Git output cap (#150532)
  fix(ui): unify fullscreen widget menu typography (#152223)
  test(gateway): synchronize unstable task registry scans (#152213)
  fix: restore automation creation for remote administrators (#151291)
  improve: defer internal agent-turn execution imports until use (#151935)
  fix(agents): resume private child results in channel conversations (#152207)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 19, 2026
…on (openclaw#152202)

A completed update could later appear as failed/abandoned when its updater exited during restarted-Gateway verification, despite the target build serving successfully.

Record the installed candidate identity before post-core handoff and let the shared update-ledger reconciliation owner verify installed and serving builds before settling the latest interrupted run. Gateway monitoring and Doctor reuse the same owner. Preserve active or unobservable drivers, newer runs, repair/rollback evidence, and legacy rows without a receipt; recheck authority and row identity inside the transaction. Report verified completion with an interruption warning and explain unresolved older abandonment in Doctor.

The receipt uses existing ledger steps, without schema, configuration, CLI, or dependency changes. Keep after.version empty until serving verification to preserve released rollback behavior.

Validation: 135 focused regressions, full changed-file checks, and published 2026.9.4 updater-to-candidate proof on isolated systemd services. SIGINT and SIGHUP during verification changed from abandoned failures to successful settlement after 10.701 and 11.835 seconds. Recorded Codex review was scoped-clean; ClawSweeper found no actionable patch defect.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes commands Command implementations docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. 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.

1 participant