Skip to content

fix: finish updates when another tool reads OpenClaw's databases during the update - #201330

Merged
steipete merged 7 commits into
mainfrom
codex/issue-197083-rebuild
Nov 18, 2026
Merged

steipete merged 7 commits into
mainfrom
codex/issue-197083-rebuild

Conversation

@steipete

@steipete steipete commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Related: #197083
Related: #201085

What Problem This Solves

An update could fail and leave the Gateway stopped when anything outside OpenClaw briefly opened its SQLite databases read-only during the update. A monitoring script using Python sqlite3 with mode=ro is enough. Doctor then reported Automatic database restoration cannot attribute migration writes: SQLite migration publication could not be verified, refused rollback because "the writer is unknown", and kept the Gateway down (state-migrated-no-rollback). One reporter was offline for 13 hours.

User Impact

User impact: updates now finish when an outside tool reads OpenClaw's databases during the update. Automatic restoration stays available because nothing was written. Any real write after Doctor admits a database still refuses as before.

Why This Change Was Made

A database's WAL file can keep committed frames after the last writer exits, for example when a status or monitoring reader is still open at the time. The next process that becomes the only connection rebuilds SQLite's WAL index (-shm) from those frames. A read-only open is enough. The rebuild resets the index change counter to zero and recomputes the header checksum. The frame count, last-frame checksum and salts stay the same, and so do the committed data. Doctor's write evidence includes that counter, so a no-write rebuild after Doctor's admission looked like a foreign commit. That happened in two places:

  • in the migration's pre-read ("SQLite migration source changed after update capture");
  • inside a single observation when the open raced the read ("SQLite WAL commit publication could not be verified").

The owner of the generation fingerprint (update-database-generations.ts) now handles both:

  • Inside one read: it accepts a header change that is exactly a rebuild, meaning only the counter (now 0) and the header checksum differ, and the file family is unchanged.
  • Across reads: every observation of a WAL database with frames also reports the fingerprint that same database would have after an index rebuild. That fingerprint uses the same file identity, the same committed-content digest and the same last-frame checksum, with the counter at 0.

Doctor's update capture remembers that alternate from its own admission. It accepts the alternate at the migration pre-read, at companion checks, at every repeated admission and at settlement.

Why the signal stays sound. The alternate binds the digest of the committed content and the last frame's cumulative checksum. Any commit after admission appends frames and changes that checksum, including a commit that restores identical content. A WAL restart changes the salts. So the alternate cannot match a real write, and those cases still refuse. A regression test covers the same-content commit. The policy for a stale initial capture (#200328) and for predecessor-stop writes (#200569) is unchanged.

Rejected alternative: extending #200328's "warn and continue" policy to changes after admission. Maintainers deliberately kept post-admission checks strict, and a rebuild with no write can be proven, so it does not need a policy exception.

Production LOC: about +75 / −12 across five files, plus a doc paragraph in docs/install/updating.md. Most of the growth is passing the new alternate field through the worker schema and the Doctor capture.

Evidence

Live reproduction and fix on Crabbox AWS (Ubuntu, c7a.8xlarge). Each lane is a managed update.run with a 400 MB state database and an outside Python sqlite3 mode=ro reader. The reader holds a read transaction while the Gateway stops, which is how frames survive. It releases when the post-install Doctor starts and opens the databases again 10–60 s later, then keeps polling.

Run Base (main 05d1e6f1f1f) With fix
2026.11.5 → target, reader polls every ~1.3 s 5/5 failed 4/5 succeeded
2026.11.4 → target, reader polls every ~1.3 s 5/5 failed 5/5 succeeded
2026.11.5 → target, reader polls every 30 s 1/1 failed 2/2 succeeded
2026.11.4 → target, reader polls every 30 s 1/1 failed 2/2 succeeded

The fix runs include alternating base/fix lanes on the same box. The last four fix runs used a package built from this PR's exact head.

Every base failure:

  • The update ended failed.
  • The Gateway was left stopped (state-migrated-no-rollback).
  • The error was SQLite migration source changed after update capture.
  • The 11.4 runs also logged cannot open your existing data.

Every successful fix run: the update succeeded, the Gateway was active on the target, and none of the watched failure signatures appeared.

The one failed fix run has a different cause. Under the aggressive 1.3 s polling, Doctor's own schema-admission step hit database is locked from the outside reader's lock. No rebuild or publication signature appeared. I'm tracking it as a separate follow-up.

Regression tests:

  • update-database-generations.test.ts: a rebuild during the read binds the rebuilt generation and equals the earlier observation's alternate.
  • update-doctor-migration-wal-rebuild.test.ts: migration is attributed when the rebuild happens during Doctor's read and after admission, with no warnings and unchanged: true. A same-content commit before the rebuild still refuses, and a rebuild between two Doctor admissions stays attributable.

On base, the first two migration cases fail with the exact user signatures (SQLite WAL commit publication could not be verified, SQLite migration source changed after update capture); with the fix they pass.

Checks:

  • Touched suites pass. Two completes retirement … cases fail locally on base and on the fix alike: Node strip-only cannot load a parameter property in update-doctor-result.ts. They are unrelated.
  • doctor-maintenance settlement and worker suites: 54/54.
  • tsgo:core, type-aware oxlint (core shard) and oxfmt are clean.

Reviews: autoreview at P2 came back scoped-clean on the final head. An independent codex exec review found one real issue: two test mocks lacked the new pair field. That is fixed in eaad4658610, and it found no other P0–P2 defect.

Head delta since the live proof. The Crabbox lanes ran a package built from eaad4658610. The landing head adds production edits, not a rebase. They fix the session-identity baseline ratchet that failed on eaad4658610, and they are behavior-equivalent to the proven head:

  • readMatchingUpdateDatabaseGeneration now takes the accepted generations as a list. It accepts the same values as before. The only theoretical widening, an empty-reader alternate equal to the rebuilt alternate, cannot occur: rebuilt alternates exist only when the WAL has frames, and empty-reader alternates only when it has none.
  • Doctor's capture still accepts the remembered rebuilt alternate at every admit() and at settlement, exactly when the observed generation equals it. It is now written as a loop over the remembered alternates.

An intermediate commit (4d705cc6ff5) briefly dropped the admit/settlement acceptance. The independent review caught that this breaks the production sequence of repeated admissions (finalization, predecessor stop, maintenance). 7c40b6de1be restores it, with a regression test that fails without the restored acceptance and passes with it.

Other changes:

  • The new tests moved to src/infra/update-doctor-migration-wal-rebuild.test.ts, because the original file hit the 1000-line cap.
  • One test caller was updated for the list signature.
  • The allowlist entry for update-database-generations.ts shrinks from 2 to 1.

Follow-up from ClawSweeper, the same-content control now updates and restores one row (WHERE value = …) and asserts the committed rows equal the admitted ones before expecting the refusal. That makes the refusal come from the new frames' checksum alone. The change is test-only.

Redacted lane output (exact eaad4658610 build as 2026.11.28; base main as 2026.11.30)
RESULT head115 2026.11.5 -> 2026.11.28 last=succeeded readyz=core active=active greps: none
RESULT head114 2026.11.4 -> 2026.11.28 last=succeeded readyz=core active=active greps: none
RESULT slowbase115 2026.11.5 -> 2026.11.30 last=failed active= greps: state-migrated-no-rollback, SQLite migration source changed after update capture, cannot attribute migration writes
RESULT slowbase114 2026.11.4 -> 2026.11.30 last=failed active= greps: state-migrated-no-rollback, SQLite migration source changed after update capture, cannot open your existing data

readyz=core means the core is ready. The lane uses a fake Telegram token, so the channel readiness probe reports degraded by design. These lane criteria check update status, the Gateway service, version, readiness and failure signatures. They do not count seeded rows separately; config is preserved, because the same openclaw.json served the target.

Head: 72e9f047d12

@clawsweeper

clawsweeper Bot commented Nov 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 commands Command implementations size: S labels Nov 18, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 18, 2026
@clawsweeper

clawsweeper Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR recognizes read-only SQLite WAL-index rebuilds without treating unchanged databases as outside writes during an update.

Example: During an upgrade from 2026.11.5, a Python sqlite3 monitoring connection opens retained WAL data using mode=ro.

  • Before: Doctor rejects the changed WAL-index counter, and the update can end state-migrated-no-rollback with the Gateway stopped.
  • After: Doctor recognizes the unchanged committed content and commit checksum, allowing the update to finish with restoration eligibility preserved.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with shipped-entry-point upgrade evidence, meaningful SQLite regressions, and the previous finding corrected; broad current-head CI is still pending.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): Public redacted output exercises managed update.run upgrades from 2026.11.4 and 2026.11.5 on Ubuntu with retained WAL frames and an outside Python reader, showing successful update, active Gateway, and core readiness with the repair; reviewed production changes since the recorded eaad465 build preserve that behavior.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A read-only monitoring connection can make Doctor reject unchanged SQLite state and leave an update unfinished with the Gateway stopped.
Reason: The maintainer-authored change repairs a reproduced failure within existing ownership and introduces no setting or broader policy change.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it addresses a verified update failure still present on fetched main. The prior finding is resolved, and no actionable introduced defect was found; current-head CI remains pending.

Priority: P1
Reviewed head: 72e9f047d1294a5c4a089337b291ceeb93255800

Before merge

None.

Findings

None.

Agent review details

How this fits together

The updater captures database generations before candidate Doctor runs; isolated inspection workers and migration attribution produce receipts that determine whether automatic database restoration remains safe.

flowchart TD
  A[Managed updater] --> B[Captured database generations]
  B --> C[Candidate Doctor]
  C --> D[Isolated generation inspection]
  E[Outside SQLite reader] --> D
  D --> F[Migration attribution and settlement]
  F --> G[Update and restoration outcome]
Loading

Technical review

Best possible solution:

Land the existing generation-owner repair after its current-head CI gate passes, keeping distinct lock and recovery failures tracked separately.

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

The supplied managed-upgrade traces reproduce the failure with a Python mode=ro monitor, and fetched main retains the rejecting predicates; this read-only review executed no target code.

Is this the best way to solve the issue?

The smallest complete fix belongs in the existing generation owner: recognize only the no-write rebuild, retain its equivalent generation through Doctor admissions, and preserve commit-sensitive refusal.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • WAL publication and generation matching keeps the original intent (50cfa7d: Allow non-writing index appearance and disappearance while retaining refusal for committed changes; the earlier matching helper came from 237fdc6.)
  • Doctor admission and settlement keeps the original intent (ad1b598: Derive committed and legacy physical generations from one observation so supported older updaters retain safe restoration receipts.)
  • Migration observations and companion checks keeps the original intent (384e6a6: Await native credential observations outside transactions while retaining migration custody; companion settlement subsequently avoided redundant probes in ba2c432.)
  • Lightweight migration context keeps the original intent (a238f1c: Keep update inspection code out of generic database-opening worker graphs; the added context method does not introduce a runtime import.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 407c309 adds src/infra/update-doctor-result.ts:243 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 407c309f27da; files: src/infra/update-doctor-result.ts)
  • Jason (Json): Raw commit 50cfa7d adds src/infra/update-database-generations.ts:125 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 50cfa7d2eb84; files: src/infra/update-database-generations.ts)
  • Dallin Romney: Raw commit 74020ea adds src/infra/update-doctor-result.ts:337 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 74020ea32fec; files: src/infra/update-doctor-result.ts)

PR surface

Source +72, Tests +201, Docs +8, Other 0. Total +281 across 13 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 5 86 14 +72
Tests 6 205 4 +201
Docs 1 8 0 +8
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 1 0
Total 13 300 19 +281

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.

Review metrics

Metric Value Why it matters
Production versus test changes Production +86/-14; tests +205/-4 Growth carries a runtime alternate through existing owners and covers within-read rebuilds, post-admission rebuilds, same-content commits, and repeated admissions.

Labels

Label changes:

  • add P1: The reproduced update failure can leave a previously serving Gateway stopped and require manual recovery.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P1: The reproduced update failure can leave a previously serving Gateway stopped and require manual recovery.
  • 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.
  • proof: sufficient: Contributor real behavior proof is sufficient.

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-18T16:23:49.240Z sha eaad465 :: needs changes before merge. :: [P2] Restore each original row in the same-content commit control

Reviewed November 18, 2026, 1:34 PM ET / 18:34 UTC (Revision 2).

@steipete
steipete marked this pull request as ready for review November 18, 2026 17:21
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T18:25:47.568799Z 7c40b6d New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

The head is now 72e9f047d12. The same-content control updates and restores one row, so the committed rows equal the admitted ones; the test asserts that before expecting the refusal. This head also fixes the session-identity ratchet and keeps the rebuilt-index alternate across repeated Doctor admissions, with a regression test. The PR body records the lane evidence and how this head differs from the live-proven build.

@clawsweeper

clawsweeper Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. 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. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 18, 2026
@steipete
steipete merged commit 0a39956 into main Nov 18, 2026
237 of 245 checks passed
@steipete
steipete deleted the codex/issue-197083-rebuild branch November 18, 2026 20:51
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 19, 2026
…ng the update (openclaw#201330)

* test(update): reproduce WAL-index rebuild refusals at migration publication

* fix(update): accept a WAL index rebuilt by an outside reader at migration publication

* refactor(update): drop redundant rebuilt-index guards

* test(update): include rebuilt-index alternates in generation-pair mocks

* refactor(update): compare accepted generations by membership; keep settlement unchanged

* fix(update): keep rebuilt-index alternates across repeated Doctor admissions

* test(update): keep the same-content control's committed rows identical

Co-authored-by: Peter Steinberger <[email protected]>
RomneyDa added a commit that referenced this pull request Nov 19, 2026
…ng the update (#201330)

* test(update): reproduce WAL-index rebuild refusals at migration publication

* fix(update): accept a WAL index rebuilt by an outside reader at migration publication

* refactor(update): drop redundant rebuilt-index guards

* test(update): include rebuilt-index alternates in generation-pair mocks

* refactor(update): compare accepted generations by membership; keep settlement unchanged

* fix(update): keep rebuilt-index alternates across repeated Doctor admissions

* test(update): keep the same-content control's committed rows identical

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

(cherry picked from commit 0a39956)

Co-authored-by: RomneyDa <[email protected]>
etzelm added a commit to etzelm/openclaw that referenced this pull request Nov 22, 2026
Main made rebuiltIndexAlternates a required field of UpdateDatabaseGenerationPair (openclaw#201330), and admit() reads it. The digest-sharing capture test mocked the pair without it.
github-actions Bot pushed a commit to clawhaven/openclaw that referenced this pull request Nov 23, 2026
…ng the update (openclaw#201330)

* test(update): reproduce WAL-index rebuild refusals at migration publication

* fix(update): accept a WAL index rebuilt by an outside reader at migration publication

* refactor(update): drop redundant rebuilt-index guards

* test(update): include rebuilt-index alternates in generation-pair mocks

* refactor(update): compare accepted generations by membership; keep settlement unchanged

* fix(update): keep rebuilt-index alternates across repeated Doctor admissions

* test(update): keep the same-content control's committed rows identical

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

(cherry picked from commit 0a39956)

Release adaptation: Adapted capture field and matching calls into existing synchronous migration-attribution owner rather than importing future async/extracted context. Preserved synchronous native custody. Removed unrelated future client credential fixture. Retained WAL frame/salt/checksum identity and true-write tests; no persistent schema change.

Co-authored-by: RomneyDa <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 24, 2026
…4095)

Closes #204078

## What Problem This Solves

On Windows, opening a read-only SQLite connection during an update's Doctor step can fail the update with “SQLite migration source changed after update capture.” A status reader, backup tool, or database browser can trigger this without writing anything. Users then need `openclaw update status` and `openclaw update repair`.

## User Impact

Read-only readers no longer count as database writes after a WAL checkpoint. A real change to committed content or file identity still refuses migration. This fix is in the candidate's Doctor, so it applies to first hops from published v2026.11.7; the installed updater needs no backport. No schema, stored-field, fingerprint-format, option, or lock changes.

## Why This Change Was Made

A checkpoint can leave an empty WAL with a nonzero shared-memory index counter and commit checksum. A read-only reopen rebuilds that disposable index and clears both values while preserving database bytes and identity. The existing rebuilt-index equivalent covered only nonempty WALs.

Extend that existing equivalent to a reader rebuild completed between capture and source verification. The equivalent still includes the original file identity and committed-content hash. The same-observation guard is unchanged. No new state, hook, retry, or reader lock. Existing native-generation and migration tests keep real-write refusal, including a checkpointed retained index followed by a reader rebuild.

Accepted edge: a reader inside the guard's own observation window can still cause a rare, visible refusal; recover with `openclaw update status`, then `openclaw update repair`. The separate SHM-absent/coarse-metadata rapid-write window in #204101 exists on main and is unchanged here; its fixture and evidence limits are recorded in that issue.

## Evidence

- Controlled original Windows failure: `8c73a489-9f22-4a56-936a-81b2f33182ce`; one read-only connection during Doctor. Clean no-reader control succeeded.
- Native Windows probe: counter `03000000` → `00000000`, checksum `0443775e300eeaf7` → `0000000000000000`, WAL length 0, with identical database SHA-256/device/inode/birthtime. Linux and macOS show the same transition; real-write controls change database hashes.
- Owning migration regression fails on unchanged main at the exact source-changed guard.
- Formatting/lint passed on the narrowed head. An earlier local test attempt failed collection because concurrent packaging rewrote `package.json`; that was setup contamination, not a product verdict.
- Narrowed head `57dc1a001943` built and passed canonical tarball validation on isolated AWS. First-hop archive SHA-256: `9e4fb9cc0fcef5f0e3bcfff94e87c75ebde704e73d41ecc2a1f4ee0ab5856714`. Its build ID is bound to that exact commit. Hosted CI is green on this head, including the Node and Bun write-refusal controls; the serial focused run on AWS passed.
- Final-head local ClawSweeper review (`4ff5ebdd239a..57dc1a0`) completed: patch correct, zero findings, security cleared.
- Windows, reader case: a first hop from published v2026.11.7 to this head with one read-only reader after the capture succeeded (run `39c3fcbb-281c-4cda-8a86-38dcccb09ad4`; the candidate serves). [Proof](#204095 (comment)).
- Windows, write control: the same first hop with one committed write during Doctor was refused at the source-changed guard (run `2c8af5ee-189c-4b6c-a39c-5f5ac745d6e5`), the user recovers by following `openclaw update status` (stop the service, then `openclaw update repair`; repair run `7a6aff24-8779-4594-833d-8d389de371a0` succeeded with warnings).
- Accepted edge case: a reader that opens inside the guard's own short observation window, while the WAL index is absent, behaves as on main (#204101).

(cherry picked from commit ab24e71)

Release adaptation: Add only the checkpointed-index explanation next to stable retained-frame documentation. Inline the checkpointed setup in the existing generation writer control because stable has the retained-frame reader coverage in update-doctor-migration-wal-rebuild.test.ts rather than the upstream retainedWalFixture. Preserve the stable malformed-anchor fixture and include the upstream attribution scenarios unchanged.

Companion audit: #201330 is present-equivalent via stable 0446f25, including retained-frame custody and repeated admission tests. 2c47390 is already selected earlier in this lane. Later same-path overlaps affect only updating.md for separate changes and are not-applicable; 1f4e88f cites this SHA as a green baseline for unrelated operator-authority tests.

Co-authored-by: Ayaan Zaidi <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 24, 2026
…ng the update (#201330)

Baseline adaptation: Carry the verified no-write WAL-index alternate through the shipped isolated Doctor capture and predecessor-stop receipt writer. Keep the flat generation inventory for older drivers and leave rollback publication and journal-mode restoration unchanged.

(cherry picked from commit 0a39956)

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit 37a272dd5846a07b5723b58a0d65a2742695c54f)
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

commands Command implementations docs Improvements or additions to documentation P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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