Skip to content

fix: recover older update handoffs during repair - #200532

Merged
roboclaw-bot merged 1 commit into
mainfrom
roboclaw/ur-200508-repair-store
Nov 17, 2026
Merged

roboclaw-bot merged 1 commit into
mainfrom
roboclaw/ur-200508-repair-store

Conversation

@roboclaw-bot

Copy link
Copy Markdown
Collaborator

Fixes #200508

What Problem This Solves

On Linux npm installations, openclaw update repair can keep refusing an interrupted update after its owners exit. A retained package journal points to the older lease store, while repair checks the empty per-user store and then reports “Another update executor owns this installation.”

User Impact

Repair now reaches the existing uncertain-handoff recovery checks in the journal-pinned store and can settle publication. A live owner or another failed recovery check preserves the evidence and reports its specific reason with a nonzero exit. Ordinary update acquisition and recovery safeguards are unchanged; no schema or protocol change is required.

Why This Change Was Made

The package-activation owner supplies the same verified journal and lease inspection used by settlement. Repair passes that store's path and identity to its existing preparation and reuses the admitted claim through settlement and finalization. Missing-store and foreign-directory recovery remain with their existing owners.

Confirmed on main: repair selected only the default store at update-repair-command.ts:194, while settlement selected the historical store at package-update-activation.ts:472.

Evidence

  • Registered-CLI regressions use separate temporary SQLite stores, a publication-complete journal, same-boot uncertain triage, and real history discovery. Both failed on base 0ffeebc9df42; both pass with the fix. Dead custody settles; a live owner produces the specific PID refusal and leaves the lease and journal unchanged.
  • Seven named repair, executor, recovery, and database-identity files: 145 passed, 149.74 seconds including worker compilation. The changed handoff file separately passed 20 tests, 25.95 seconds in Vitest / 30.40 seconds including the wrapper. CI timing is not yet available.
  • CI's core-leaf oxlint command passed on the three touched TypeScript files: --type-aware --type-check --threads=1 --tsconfig config/tsconfig/oxlint.core.json. Touched-file oxfmt --check and git diff --check passed.
  • pr-simplify completed. Shared journal preparation avoids a second store-selection policy; net growth is 28 production lines, 81 test lines, and 13 documentation lines. Independent autoreview reported scoped-clean for P0–P2; it was source-only and noted omitted surrounding settlement/finalization context.

No live Linux installation or latest-stable upgrade reproduction was run. Doctor/plugin effects and host observations are controlled in these CLI tests; the parent decides on live proof. Broad validation belongs to PR CI under the host limits.

Reported by @garrietv (with source diagnosis)

Work sessions

Linked for team reference; these sessions aren’t public.

@clawsweeper

clawsweeper Bot commented Nov 17, 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: S labels Nov 17, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 17, 2026
@clawsweeper

clawsweeper Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

Repair discovers the package journal’s historical lease store and reuses its recovery claim through publication settlement and finalization.

Example: A Linux npm installation has a publication-complete journal pointing to /tmp/openclaw/managed-update-handoffs.sqlite, while /tmp/openclaw-1000/managed-update-handoffs.sqlite is empty.

  • Before: Repair misses the dead uncertain-triage lease and fails with “Another update executor owns this installation.”
  • After: Repair checks the historical lease through the existing recovery owner, settling eligible custody or reporting the specific refusal.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The focused implementation and meaningful regressions support correctness, but required real-installation and upgrade proof is absent.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: An interrupted update remains unrecoverable because repair checks an empty store before settlement encounters retained custody elsewhere.
Reason: The maintainer-authored direction restores documented repair behavior for a concrete affected-release report with a narrow change.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open: this maintainer-authored PR addresses a current-main recovery defect, and source review found no introduced correctness bug.

Priority: P2
Reviewed head: 78767c4017368af3b00994506fc805ddf86ec296

Before merge

  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

None.

Tests

  • Missing end-to-end proof: Supply a real Linux npm CLI recovery trace for separate historical/current stores and a v2026.11.4-to-fixed upgrade run showing settings and data preserved.
Agent review details

How this fits together

The update repair CLI coordinates retained package journals, SQLite handoff custody, publication settlement, and maintenance; verified recovery produces a settled journal and durable completion receipt.

flowchart TD
  A[Update repair CLI] --> B[Package journal inspection]
  B --> C[Historical lease store]
  C --> D[Existing recovery checks]
  D --> E[Admitted repair claim]
  E --> F[Publication settlement]
  F --> G[Maintenance and completion]
Loading

Technical review

Best possible solution:

Use the existing package-recovery owner to select the historical store and carry one admitted repair claim through settlement and finalization.

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

The affected-release report and current-main source establish the separate-store failure path; the PR reports matching red/green CLI regressions, which were inspected but not executed during this read-only review.

Is this the best way to solve the issue?

The patch addresses the discovery mismatch at its existing owner, preserves recovery admission, and adds two distinct regression cases without new state or parallel policy.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Repair store selection changes intended behavior with a stated reason (73858ce: The earlier macOS repair change unified current placement and retained an explicit fallback for custody in an older Gateway store.)
  • Shared settlement journal preparation keeps the original intent (a7a8c39: Completed multiply linked journals may be inspected for archival while active recovery retains its stricter journal contract.)
  • Repair claim through settlement and finalization keeps the original intent (b277db0: Fresh admission cannot replace cancelled custody after repair has already acquired the installation; settlement must reuse the existing claim.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source +28, Tests +81, Docs +13. Total +122 across 5 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 36 8 +28
Tests 1 81 0 +81
Docs 2 13 0 +13
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 130 8 +122

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add P2: The supported repair command is blocked for a specific retained-state configuration, while the reported installation’s Gateway remains healthy.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.

Label justifications:

  • P2: The supported repair command is blocked for a specific retained-state configuration, while the reported installation’s Gateway remains healthy.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 17, 2026, 4:49 AM ET / 09:49 UTC.

@roboclaw-bot
roboclaw-bot merged commit ae31ea3 into main Nov 17, 2026
141 checks passed
@roboclaw-bot
roboclaw-bot deleted the roboclaw/ur-200508-repair-store branch November 17, 2026 10:09
RomneyDa added a commit that referenced this pull request Nov 17, 2026
Repair uncertain handoffs in the verified historical lease store pinned by the
package journal, then reuse the admitted claim for settlement. Existing recovery
checks and ordinary admission remain unchanged.

Fixes #200508
Reported-by: @garrietv

(cherry picked from commit ae31ea3)

Co-authored-by: steipete <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 18, 2026
…law#200532)

`openclaw update repair` prepared uncertain-handoff recovery in the default per-user lease store, while package settlement then entered the lease store pinned by the package activation journal. When that journal pinned an existing historical store (such as the legacy /tmp/openclaw store) holding a stale uncertain triage lease, ordinary admission refused with "Another update executor owns this installation", so repair could never settle. Repair now reads the journal through the same reader settlement uses, runs its existing recovery checks against the pinned store, and reuses the admitted claim for settlement. Recovery checks and ordinary admission are unchanged; without a pinned store, repair behaves as before.

Fixes openclaw#200508
Reported-by: @garrietv

Co-authored-by: steipete <[email protected]>
RomneyDa added a commit that referenced this pull request Nov 19, 2026
…e publishing the package (#200460)

* fix(update): keep openclaw runnable when an npm update is killed while publishing the package

* test(update): avoid a shadowed name in the surviving exchange tool test

* test(update): keep the displacement refusal and manifest-read tests on their paths

(cherry picked from commit 413d9ee)

Companion disposition: #200273 and #200366 prerequisites included; #200532 and #200550 recovery companions follow. Release adaptation: none.

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit 156510063401de1ab38e8def5d0acfe381ef813f)
RomneyDa added a commit that referenced this pull request Nov 19, 2026
`openclaw update repair` prepared uncertain-handoff recovery in the default per-user lease store, while package settlement then entered the lease store pinned by the package activation journal. When that journal pinned an existing historical store (such as the legacy /tmp/openclaw store) holding a stale uncertain triage lease, ordinary admission refused with "Another update executor owns this installation", so repair could never settle. Repair now reads the journal through the same reader settlement uses, runs its existing recovery checks against the pinned store, and reuses the admitted claim for settlement. Recovery checks and ordinary admission are unchanged; without a pinned store, repair behaves as before.

Fixes #200508
Reported-by: @garrietv

Co-authored-by: steipete <[email protected]>
(cherry picked from commit ae31ea3)

Release adaptation: none. Companion disposition: update publication, custody, Doctor and best-effort maintenance fixes are ported together in dependency order; #200331 supplies the owed-step owner required by #200507/#200579.

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit 8d8ace39e6d59c2017d197ac460dc4d489c95a84)
maplel pushed a commit to maplel/openclaw that referenced this pull request Nov 24, 2026
…aw#194058)

Failed-update triage now captures the operator's environment before managed candidate admission, so a coding agent installed only on the operator's PATH is still offered when the Gateway service's PATH differs. Restores the operator-environment contract from openclaw#134490 and keeps the launch confirmation from openclaw#143139.

Proof: shipped CLI on isolated Linux (Crabbox) with a running systemd Gateway: accept launches the operator-only agent, decline starts nothing, base 18bee8e reports no agent found; published 2026.11.1 upgrades to the fix with settings intact.

Co-authored-by: TorstenW <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: steipete <[email protected]>

(cherry picked from commit 7c702c3)

Release adaptation: Capture invoking operator env before candidate admission, forward to interactive triage only; preserve latest target selectors, confirmation and lease cleanup ordering. Exact three authorized production paths plus real lifecycle regression.

Follow-up dispositions: ad4863d fix: preserve the running installation when an agent updates its Gateway (openclaw#201570); dc73ec0 fix: let updates finish when another tool briefly reads OpenClaw's databases (openclaw#202541); d07b530 fix: clarify PostgreSQL schema upgrades for Git installs (openclaw#202098); e60ea9f test(update): add a Git release upgrade-survivor scenario (openclaw#201956); 2ef6f7b fix(update): build and serve Git releases outside node_modules (openclaw#201917); dbc1aa0 fix: keep the openclaw command and Gateway working after updating a pnpm install (openclaw#201735); f5e7641 fix: Git checkout updates across a schema change no longer end as post-update-failed after the new release starts (openclaw#201600); 2183caf fix: Git checkout updates no longer fail before the new release starts on a schema change or a busy database (openclaw#201463); 47e8649 fix: explain why Doctor cannot restore a scheduled job’s account (openclaw#201550); 8f2cfd4 fix: remove updater-only restrictions from agent maintenance guidance; cb5cfb2 fix: keep a doubtful killed-update recovery on the repair path (openclaw#201361); 24cb734 fix: keep carried-over scheduled jobs running after updates (openclaw#200653); d1276e1 feat(doctor): check OpenClaw ID member roles and honor an optional roles default (openclaw#197785); 0a39956 fix: finish updates when another tool reads OpenClaw's databases during the update (openclaw#201330); ea1c9d5 fix(update): settle remounted package publications before admission (openclaw#201336); 66b5212 fix(update): isolate malformed retained-install markers (openclaw#201199); 7e79c83 fix: let the next update finish a killed source checkout update (openclaw#201009); d905d8a fix: let the next update finish a killed update after the machine restarted (openclaw#200994); fdf0c95 fix: let the next update finish a killed update that had already installed the new version (openclaw#200866); 0c19bcd chore(release): close out 2026.11.5 on main (openclaw#200577); a1940e0 fix(matrix): keep explicit recovery available during deferred migration (openclaw#200805); 18b4776 improve: explain package baseline drift during updates (openclaw#200802); 1ad4cad fix(doctor): reclaim macOS updater runtimes blocked by non-updater processes (openclaw#200732); 427c857 fix: keep one missing archived transcript from blocking every update (openclaw#200733); 802e3f7 fix(update): keep valid cold archives from blocking updates (openclaw#200659); 23fca1a fix: let the next update continue after a killed update when nothing is left to repair (openclaw#200680); 3afe212 fix: let Doctor publish unchanged plugin migrations in any order (openclaw#200658); f65e4db fix(doctor): reclaim runtimes blocked by unrelated Linux processes (openclaw#200657); dab086c fix(update): let candidate Doctor read plugin dependencies from the staged package (openclaw#200595); 3447bee fix(update): keep updates going when the predecessor writes during its stop (openclaw#200569); 0ce9c77 fix: let the next update settle a package publication that a killed update left behind (openclaw#200550); ae31ea3 fix(update): repair handoffs in the journal-pinned lease store (openclaw#200532); 74020ea fix: continue updates when initial SQLite capture is stale (openclaw#200328); 6747b1e feat(update): run Git checkout installs from releases behind the release link (openclaw#199706); e3f8a67 fix(state): keep completed retained agent stores out of startup upgrade (openclaw#200284); 3c512c5 fix(gateway): move managed update lease operations off the main thread (openclaw#200169); ea69fcb chore(release): close out 2026.11.4 on main (openclaw#199956); 618bf31 fix(state): bound startup upgrade copies and pruning to owned state (openclaw#199929); e4a3093 perf(update): replace the candidate canary with a runtime contract check (openclaw#198268); 5dbf569 fix(update): plugin failures never fail an update or Gateway health; 764761e fix(update): refuse missing host prerequisites in one line and record a cause per attempt; 4c4fef4 fix(ui): update dialog claims installation before progress is confirmed (openclaw#199254); 136e1f6 fix(update): retrying an update from a dev checkout is refused after a killed update (openclaw#198673); 3bd03da fix(update): avoid duplicate database copies while the Gateway is stopped (openclaw#198148); 68a839b fix: isolate held agent databases until explicit restoration (openclaw#198180); e333f7e chore(ci): drop retired test-lines allocation records (3/3) (openclaw#197657); fd6fa47 fix: converge Gateway updates with environment-only service overrides (openclaw#196371); 7cf5e75 fix: clarify split-install updates and blocked Doctor repairs (openclaw#196342); 6ff8c86 fix(update): retain lazy sqlite catalog generation (openclaw#197095); 930e1f7 fix: keep stable updates and recovery free of premature migrations (openclaw#196474); a15f737 fix: preserve external plugin data during update rehearsal (openclaw#196301); 92798ae fix: updates survive interrupted heartbeat runs (openclaw#195656); c1e55e2 fix(update): restore LaunchAgent registration after repair contention (openclaw#195406); 715c610 fix(doctor): repair retained ISO session end timestamps (openclaw#194685); 689cfc8 fix(update): reclaim dead closing triage repair leases (openclaw#194503); 86bc89e fix(doctor): keep standing Codex parameter advice out of retirement blockers (openclaw#193650); 691bc8d fix(backup): read the backup engine without copying the live database (openclaw#194234); 000542f fix(backup): backups and updates fail on slow storage when a header probe batch misses its deadline (openclaw#194239); 31a65d5 fix(update): skip --no-lazy-fetch on Git versions without it (openclaw#194198); e45e99d fix(update): preserve dev update sources in tag-only Git clones (openclaw#193109)

Validation: Baseline2 intended operator-agent failures/32 controls passed; candidate34/34passed (194058-green.log). Accept launches synthetic operator-only CLI with expected env, decline starts nothing. Isolated updater flow, not live systemd/upgrade qualification.

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit 6689fd575ada8fe40a9593784deac18ec73041cd)
(cherry picked from commit 92e7a9fa223b0dc35801f25f70be90b472d9a6b7)
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 P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: 2026.11.4 update repair misses legacy triage custody when package recovery pins a different lease store

1 participant