Skip to content

fix: refuse incompatible Windows 9.4 schema upgrades - #160718

Merged
steipete merged 3 commits into
mainfrom
codex/windows-94-schema-admission-150153-20260928
Sep 29, 2026
Merged

steipete merged 3 commits into
mainfrom
codex/windows-94-schema-admission-150153-20260928

Conversation

@steipete

@steipete steipete commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Related: #150153

What Problem This Solves

The published 2026.9.4 Windows updater can migrate shared state and then fail when its retained service-handoff callback opens that state with the old reader. A refusal during candidate Doctor is too late to provide reliable guidance: the old repair path can replace that result with a copied-database cleanup error.

User Impact

During a marked Windows 9.4 update, candidate postinstall now delegates to Doctor’s read-only schema guard before package activation. An incompatible shared-state upgrade fails staging with the existing manual-upgrade guidance. Ordinary package installation, source checkouts, other platforms, and current delegated Doctor flows retain their behavior. This is containment; it does not complete the old driver’s automatic update.

Operators must let the updater finish, then keep their original service account, package prefix, profile, and state/config overrides when following the documented independent-shell package-manager route. No intermediate published version is assumed safe. Maintainer disposition: accept this narrow containment and the documented independent-shell recovery cost after the qualified native result below. The automatic-upgrade gap remains open; this PR changes no stored-data schema, durability, retention, or recovery authority.

Why This Change Was Made

The shipped driver requires the candidate’s content version before handoff, then its old callback reads that content again. Deferring only the published version cannot satisfy both checks. Its normal and omit-optional npm attempts inherit the existing update marker and selected environment; failure of both attempts returns before candidate repair. Its pending-lifecycle completion also calls postinstall before validation when that marker remains.

The package entry confirms the legacy driver, requests only shared-state preflight, and reuses the same guard after that await. Private SQLite copies are closed and cleaned up; no operator-state migration occurs. Missing or unobservable driver identities do not prove death. A refusal retains the package lifecycle marker. The CLI guard remains for other candidate Doctor callers. No CLI option, schema, durable receipt, or rollback authority changes.

Evidence

  • The retained published-driver diagnostic identifies the old schema reader through getUpdateRun and Windows handoff before transfer. The exact rejected version was not captured; the original automatic failure remains failed.
  • The earlier d1 containment attempt returned naturally with exit 1. Its ledger recorded failed migration rehearsal, but old repair cleanup replaced the original result with EBUSY. The intended refusal reason and full after-state comparison were not captured. That attempt remains unqualified and motivated the earlier package entry.
  • The actual postinstall entry failed its new refusal case on the original code while three controls passed. The successor passes all 29 lifecycle tests and 16 schema-guard cases. The corrected named .js package entry was rechecked with four focused cases; these are not counted twice. Local schema cases use prepared facts and a mocked native snapshot boundary, not Windows proof.
  • Fresh full-PR and successor reviews are clean through P2. Type checks, own-scope lint, all three export scans, import-cycle checks, and structural guards pass. The initial export finding was fixed by registering the real compiled entry in Knip. Global lint retained an unchanged Doctor line-cap failure, independently matched to canonical fix fix(ci): restore Doctor plugin repair lint budget #160715; no cap exception or unrelated source edit was added.
  • Package Acceptance at 0ec passed. Its CI exposed a branch-caused source-build defect: the literal installed-runtime import was followed by the source-worker compiler. The corrected runtime file URL preserves the installed entry without compiling dist. A real tsdown regression fails with the literal import and passes with the URL; all 30 postinstall cases pass (2.51 seconds Vitest wall, 3.60 seconds wrapper). The source-worker guard is unchanged. A fresh scoped P2 review is clean; the complete selected checks also pass. Corrected-head Package Acceptance passed at c4a248a1c7ccfa13ecbe7047c25d35a6743488e3. Its CI completed with 111 successful jobs, 26 cancellations, 18 skips, and one originating session-lifecycle test failure plus the aggregate gate. The failure is sessions.delete serializes a patch behind asynchronous runtime cleanup (patched.ok was true). The session test barrier was subsequently traced to read-context initialization preceding real patch capture. The canonical test-only repair reproduced the original group at 205 passed / 1 failed and passed all 206 after moving the barrier. Removing the production disappeared-row guard still fails the original assertion. Both repaired test preimages match this CI merge; production policy was unchanged. This CI result remains failed, and the 26 canceled jobs remain unrun. The published Windows 9.4 × exact-package containment attempt, using reviewed tooling 233f8204 and authenticated artifact 11010504032, stopped before invoking the updater: its peer snapshot rejected a truncated diagnostic process list. The completed selected snapshot remains retained; seven CLI commands returned zero and joined, and cell/final cleanup passed. This attempt is unqualified. The reviewed fixture correction preserves profile membership, full native creation-time precision, and all existing bounds while selecting the exact PID before the display cap. It also asserts zero activation effects for an optional new recovery row. The next containment attempt reached both intended npm refusals and preserved the observed services, but its aggregate schema hash changed. It remains unqualified: that capture could not distinguish expected old-driver ledger creation from other schema changes.
  • The final published Windows 9.4 containment cell, tooling c8e023b1 with the same exact c4a248a1 package, qualifies the intended refusal before activation. The unchanged old updater naturally returned 1 in 182.378 seconds; both npm attempts retained the complete actionable refusal. Selected and peer PIDs, native creation times, RPC build, launchers, configuration, canaries, and package fingerprints remained unchanged. Shared-state content and published versions stayed 17/17; both agent databases remained 19/19. All 334 previous shared-schema objects and all previous table contents matched. The only added objects were the four exact objects produced by the shipped 9.4 ledger DDL, independently reproduced in memory, with one row bound to this command’s UUID and no activation effects. This narrow old-driver bookkeeping exception does not excuse arbitrary schema or data changes.
  • All ten recorded CLI commands and four preparation groups joined. Scoped native cell and final Scheduled Task cleanup passed. The outer Vitest launcher retained a temporary namespace because descendant completion is unverified for its non-group launch; this is not an all-descendants-clean claim. The original assertion, failed workflow/reducer, skipped fresh/9.3 cells, and skipped successful-cell retirement remain visible. Automatic Windows 9.4 completion and the wider published-driver campaign remain open under fix: keep task recovery working across shared Gateway updates #150153.

Refuse shared-state migration during the shipped Windows 9.4 raw Doctor preflight while its recorded updater drivers have not positively stopped. Keep the existing delegated Doctor and 9.2 publication paths unchanged. Split manual recovery text so the shipped canary retains the reason and commands within its per-line capture limit. This contains the old callback failure; it does not complete automatic 9.4 updates.
@clawsweeper

clawsweeper Bot commented Sep 28, 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: M labels Sep 28, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 28, 2026
@clawsweeper

clawsweeper Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 29, 2026, 2:37 AM ET / 06:37 UTC (Revision 12).

ClawSweeper review

What this changes

The branch adds a read-only package postinstall preflight for marked Windows 2026.9.4 updates, with refusal guidance, documentation, and regression tests.

Merge readiness

⛔ Blocked before merge - 2 items remain

Current main and the latest release still lack the early Windows 2026.9.4 staging guard. This PR has a distinct containment purpose, and its updated record supports that purpose in a native Windows run.

Priority: P0
Reviewed head: c4a248a1c7ccfa13ecbe7047c25d35a6743488e3

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The focused guard and its tests have a qualified native containment record; exact-head CI admission remains to be reconciled.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (linked_artifact): The package postinstall entry calls the compiled Doctor guard. The PR’s linked native Windows 2026.9.4 cell used the exact candidate package and records two pre-activation refusals with previous service identities and database contents preserved. GitHub confirms the cell artifact and aggregate failure; the detailed artifact could not be opened through this review environment’s proxy, so its stated comparisons remain contributor-recorded evidence. No stored data-model contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The package postinstall entry calls the compiled Doctor guard. The PR’s linked native Windows 2026.9.4 cell used the exact candidate package and records two pre-activation refusals with previous service identities and database contents preserved. GitHub confirms the cell artifact and aggregate failure; the detailed artifact could not be opened through this review environment’s proxy, so its stated comparisons remain contributor-recorded evidence. No stored data-model contract changes.
Evidence reviewed 8 items Introduced package entry: The introduced postinstall path imports the compiled Doctor guard on marked packaged Windows updates, refuses on an error, and leaves the lifecycle marker intact.
Read-only refusal boundary: The guard reads a private SQLite snapshot, recognizes running 2026.9.4 records, treats unknown driver liveness conservatively, and blocks a pending shared-state upgrade beyond schema 17.
Current-main necessity: Current main runs packaged postinstall directly into lifecycle completion without the introduced Windows schema check.
Findings None None.
Security None None.

How this fits together

The published updater runs the candidate package’s postinstall script while staging new OpenClaw code. The script asks Doctor’s database preflight whether the old updater could reopen migrated shared state, then completes staging or reports a refusal.

flowchart LR
A[Published Windows updater] --> B[Candidate package postinstall]
B --> C[Read-only schema preflight]
C --> D{Active 9.4 driver and incompatible upgrade?}
D -->|Yes| E[Refusal and recovery guidance]
D -->|No| F[Complete package staging]
Loading

Before merge

  • Complete next step (P2) - Reconcile the failed exact-head CI gate against the landed session-test repair, accounting for canceled coverage through the native landing workflow before merge.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

Source +94, Tests +301, Docs +25, Other +21. Total +441 across 10 files.

View PR surface stats
Area Files Added Removed Net
Source 2 113 19 +94
Tests 3 305 4 +301
Docs 2 25 0 +25
Config 0 0 0 0
Generated 0 0 0 0
Other 3 22 1 +21
Total 10 465 24 +441

Review metrics

Metric Value Why it matters
Production versus test growth production/tooling +115, tests +301 The added package admission path has distinct guard and subprocess coverage, with a recorded native Windows containment cell.

Stored data model

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

Technical review

Best possible solution:

Keep the previous Gateway usable when the old driver cannot safely finish; make recovery available through a visible Doctor or Fix launcher, and complete automatic upgrade support in the broader updater work.

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

Yes. The source and linked native run establish a specific path: the published 2026.9.4 Windows updater stages a candidate that would move shared state beyond schema 17. This review did not execute that path locally.

Is this the best way to solve the issue?

Yes for the narrow containment: package staging uses Doctor’s existing read-only preflight before the old callback can encounter migrated state. Automatic completion remains separate updater work.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 4ee8770db67d.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The package postinstall entry calls the compiled Doctor guard. The PR’s linked native Windows 2026.9.4 cell used the exact candidate package and records two pre-activation refusals with previous service identities and database contents preserved. GitHub confirms the cell artifact and aggregate failure; the detailed artifact could not be opened through this review environment’s proxy, so its stated comparisons remain contributor-recorded evidence. No stored data-model contract changes.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P0: The shipped Windows update path can stop on an incompatible schema, and completing recovery requires independent-shell commands that block a nontechnical user.
  • merge-risk: 🚨 compatibility: The accepted containment deliberately changes an affected 2026.9.4 automatic upgrade into a refused stage requiring manual recovery.
  • merge-risk: 🚨 availability: Package-stage admission now controls whether a marked Windows update proceeds, making preservation of the previous Gateway and package a material merge consideration.
  • 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 (linked_artifact): The package postinstall entry calls the compiled Doctor guard. The PR’s linked native Windows 2026.9.4 cell used the exact candidate package and records two pre-activation refusals with previous service identities and database contents preserved. GitHub confirms the cell artifact and aggregate failure; the detailed artifact could not be opened through this review environment’s proxy, so its stated comparisons remain contributor-recorded evidence. No stored data-model contract changes.
  • proof: sufficient: Contributor real behavior proof is sufficient. The package postinstall entry calls the compiled Doctor guard. The PR’s linked native Windows 2026.9.4 cell used the exact candidate package and records two pre-activation refusals with previous service identities and database contents preserved. GitHub confirms the cell artifact and aggregate failure; the detailed artifact could not be opened through this review environment’s proxy, so its stated comparisons remain contributor-recorded evidence. No stored data-model contract changes.

Evidence

What I checked:

  • Introduced package entry: The introduced postinstall path imports the compiled Doctor guard on marked packaged Windows updates, refuses on an error, and leaves the lifecycle marker intact. (scripts/postinstall-bundled-plugins.mjs:409, c4a248a1c7cc)
  • Read-only refusal boundary: The guard reads a private SQLite snapshot, recognizes running 2026.9.4 records, treats unknown driver liveness conservatively, and blocks a pending shared-state upgrade beyond schema 17. (src/commands/doctor-update-schema-guard.ts:72, c4a248a1c7cc)
  • Current-main necessity: Current main runs packaged postinstall directly into lifecycle completion without the introduced Windows schema check. (scripts/postinstall-bundled-plugins.mjs:409, 4ee8770db67d)
  • Latest-release boundary: The latest release, v2026.9.6, also completes postinstall without this guard; the PR’s central behavior has not shipped. (scripts/postinstall-bundled-plugins.mjs:409, eb377ac59e6c)
  • Native containment record: The PR body records two actionable npm refusals from the exact candidate package, unchanged prior database contents and service identities, and only the old driver’s identified ledger bookkeeping. The linked Windows run confirms package handoff, a retained cell artifact, cleanup, and an aggregate failure; its artifact contents could not be independently opened through this review environment’s network proxy.
  • Accepted recovery tradeoff: After the prior review requested a decision, the updated PR body explicitly accepts the narrow refusal and independent-shell recovery cost. GitHub verifies its author has repository admin permission. The Windows documentation states the resulting operator steps. Public docs: docs/platforms/windows.md. (docs/platforms/windows.md:246, c4a248a1c7cc)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Ayaan Zaidi: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Jason (Json): Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; 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 (11 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-28T23:41:42.793Z sha d1c2904 :: blocked before merge. :: none
  • reviewed 2026-09-29T01:35:35.997Z sha 0ec85fe :: blocked before merge. :: none
  • reviewed 2026-09-29T01:48:51.591Z sha 0ec85fe :: blocked before merge. :: none
  • reviewed 2026-09-29T03:02:21.357Z sha c4a248a :: blocked before merge. :: none
  • reviewed 2026-09-29T03:27:42.655Z sha c4a248a :: blocked before merge. :: none
  • reviewed 2026-09-29T03:44:26.154Z sha c4a248a :: blocked before merge. :: none
  • reviewed 2026-09-29T04:18:48.104Z sha c4a248a :: blocked before merge. :: none
  • reviewed 2026-09-29T04:50:02.494Z sha c4a248a :: blocked before merge. :: none

@steipete
steipete marked this pull request as ready for review September 28, 2026 22:29
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 28, 2026
@openclaw-barnacle openclaw-barnacle Bot added the scripts Repository scripts label Sep 29, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Sep 29, 2026
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Sep 29, 2026
steipete added a commit that referenced this pull request Sep 29, 2026
Placement lookups also run during session-read fixture initialization,
before the patch handler captures its target. Waiting on that lookup could
release deletion too early and let patch correctly create a missing row.
Observe the real patch-preparation operation in the delete and restore
fixtures instead, and restore spies after joined cleanup.

No production policy, queue, creation, timeout, or response assertion changes.
Original 16-file group: 205 passed/1 failed before, 206 passed after.
Both owning files: 32 passed; final command wall time 59.2 seconds.
Removing the existing disappeared-row guard fails the original assertion.
Gateway test types, structural guards and export scans passed; two disposal
binding lint errors were repaired, then focused lint/format and the owning
files passed. Fresh independent P0-P2 review found no actionable issues.

Observed in CI 36514696016/job109234680606 during #160718.
@clawsweeper clawsweeper Bot added P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. and removed P1 High-priority user-facing bug, regression, or broken workflow. labels Sep 29, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 29, 2026
Placement lookups also run during session-read fixture initialization,
before the patch handler captures its target. Waiting on that lookup could
release deletion too early and let patch correctly create a missing row.
Observe the real patch-preparation operation in the delete and restore
fixtures instead, and restore spies after joined cleanup.

No production policy, queue, creation, timeout, or response assertion changes.
Original 16-file group: 205 passed/1 failed before, 206 passed after.
Both owning files: 32 passed; final command wall time 59.2 seconds.
Removing the existing disappeared-row guard fails the original assertion.
Gateway test types, structural guards and export scans passed; two disposal
binding lint errors were repaired, then focused lint/format and the owning
files passed. Fresh independent P0-P2 review found no actionable issues.

Observed in CI 36514696016/job109234680606 during openclaw#160718.
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 29, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Sep 29, 2026
@steipete
steipete merged commit 0703c21 into main Sep 29, 2026
289 of 318 checks passed
@steipete
steipete deleted the codex/windows-94-schema-admission-150153-20260928 branch September 29, 2026 09:59
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 30, 2026
* fix: refuse incompatible Windows 9.4 schema upgrades

Refuse shared-state migration during the shipped Windows 9.4 raw Doctor preflight while its recorded updater drivers have not positively stopped. Keep the existing delegated Doctor and 9.2 publication paths unchanged. Split manual recovery text so the shipped canary retains the reason and commands within its per-line capture limit. This contains the old callback failure; it does not complete automatic 9.4 updates.

* fix: refuse legacy Windows migration during package staging

* fix(update): load package lifecycle guard only at runtime
RomneyDa pushed a commit that referenced this pull request Oct 1, 2026
* fix: refuse incompatible Windows 9.4 schema upgrades

Refuse shared-state migration during the shipped Windows 9.4 raw Doctor preflight while its recorded updater drivers have not positively stopped. Keep the existing delegated Doctor and 9.2 publication paths unchanged. Split manual recovery text so the shipped canary retains the reason and commands within its per-line capture limit. This contains the old callback failure; it does not complete automatic 9.4 updates.

* fix: refuse legacy Windows migration during package staging

* fix(update): load package lifecycle guard only at runtime

(cherry picked from commit 0703c21)
RomneyDa added a commit that referenced this pull request Oct 1, 2026
* fix: preserve plugin settings through update recovery (#160344)

Keep incompatible local plugin configuration intact and complete deferred migration confirmation after unchanged package convergence. Use completion receipts to clear obsolete retry warnings without rewriting update history.

Fixes #159477. Thanks @EndeavorPioneer for the recovery report.

(cherry picked from commit 8e66b0b)

* fix: prevent duplicate Gateways during container onboarding (#160193)

* fix: prevent duplicate Gateways during container onboarding

* fix: keep QA cron controls scoped to the child

Drop inherited parent cron suppression while preserving explicit child runtime
settings. Cover the failing inheritance contract at the environment owner.

Await node-list RPC responses after acknowledged rename and reconnect events
without racing the existing RPC deadline against a separate polling timeout.

(cherry picked from commit 54b1b1b)

* fix: refuse incompatible Windows 9.4 schema upgrades (#160718)

* fix: refuse incompatible Windows 9.4 schema upgrades

Refuse shared-state migration during the shipped Windows 9.4 raw Doctor preflight while its recorded updater drivers have not positively stopped. Keep the existing delegated Doctor and 9.2 publication paths unchanged. Split manual recovery text so the shipped canary retains the reason and commands within its per-line capture limit. This contains the old callback failure; it does not complete automatic 9.4 updates.

* fix: refuse legacy Windows migration during package staging

* fix(update): load package lifecycle guard only at runtime

(cherry picked from commit 0703c21)

* fix(anthropic): prevent stuck turns after background Bash completes (#161260)

* fix(anthropic): release backgrounded Bash hold on task-notification result

* fix(anthropic): settle background replies without stalled or prematurely closed turns

Keep native Bash, agent, and workflow completions attached until consumed. Correlate queued and inline acknowledgements, preserve failure retirement, and distinguish automatic Bash timeouts from explicit background requests using authorized input. Add transport regressions; verify real Claude producer ordering and patched warm-session reuse.

Co-authored-by: VACInc <[email protected]>

---------

Co-authored-by: VACInc <[email protected]>
(cherry picked from commit 38dd3c2)

* fix: preserve maintenance leases during SQLite contention (#160702)

(cherry picked from commit 3328283)

* fix(gateway): preserve proxy policy in local TLS health probes (#161946)

(cherry picked from commit 649b19f)

* fix(telegram): prevent empty retired bindings from blocking updates (#161832)

* test(telegram): cover empty retired bindings migration

* test(doctor): cover empty Telegram migration receipt

* fix(telegram): archive verified empty retired bindings

Co-authored-by: ericcaiwx-star <[email protected]>
(cherry picked from commit 646ac9a)

* fix(doctor): keep session repair iterative on deep canonical owner chains (#162321)

Doctor's session-repair step overflowed the stack (RangeError: Maximum call stack size exceeded) on large but healthy agent databases during 2026.9.7 update activation: canonical-owner resolution followed canonicalOwnerSessionKey alias chains recursively, and row-count-sized spreads sat on the same path. Resolution is now iterative with the same terminal-owner, missing-owner, and cycle outcomes, and the spreads are linear reductions with unchanged empty-input behavior. A healthy 12,000-owner / 200,000-event fixture fails pre-fix and passes post-fix; the published-driver upgrade preserved transcript bytes.

Closes #161979

(cherry picked from commit 9fb7ba2)

* fix(launcher): keep the Node compile-cache path short on Windows (#162841)

2026.9.7 lengthened the compile-cache marker from <mtime>-<size> to build-<buildId>, which pushed cache paths on Windows into the directory-length window where Node 24's module.enableCompileCache() never returns (nodejs/node#66438); every OpenClaw process start could then spin at full CPU. The shared cache owner now uses a 16-character hash of the full build id as the marker, refuses Windows cache paths over 200 characters with a recorded warning (cache off for that process), and no longer propagates an unsafe inherited cache path to children. Legacy namespace handling and POSIX behavior are unchanged; native Windows/Node 24.18 completes the packaged CLI with a 220-character TEMP in 2.4 s.

Closes #162821

(cherry picked from commit 6e987af)

* fix(codex): prevent Gateway heap exhaustion with large agent fleets (#162912)

Closes #162802

## What Problem This Solves

Fixes Gateway heap exhaustion during Codex session discovery on large agent fleets. Thanks to @609NFT for the report and allocation profiles.

## User Impact

Large fleets can finish startup and retain their native Codex session catalog without retaining a whole fleet configuration for every agent/home pair. No schema, stored-data, configuration, or catalog-output changes are required.

## Why This Change Was Made

The existing config-identity cache now owns one captured configuration per generation. Agent/home entries keep their separate directories and cloned connection options, but share that captured configuration. Config reload isolation and source-specific backoff remain unchanged.

No overlap with Pash/Sarah changes.

Codex source inspection: `codex-rs/app-server/src/request_processors/thread_processor.rs:2524–2608` in the sibling Codex checkout confirms that `thread/list` consumes pagination and filter parameters; the fleet configuration capture being repaired belongs to OpenClaw, not the native listing protocol.

## Evidence

Compared baseline `7ef388bac8f607eb03510189922d1c6a4d786b52` with candidate `f0ae922f60922f2b357bc3d5af22a2142799fbe0` in isolated Linux arm64 Docker containers, Node 24.21.0. The synthetic profile contained 739 agents, eight explicit Codex homes, and three native sessions (380,439 bytes of configuration).

| Check | Baseline | Candidate |
| --- | --- | --- |
| Real Gateway, 2,560 MiB heap | Heap OOM at 100.3 s | Survived the six-minute window; clean shutdown |
| Sampled catalog allocations under `resolveRequestOptions` → `structuredClone` | 2.248 GB | 5.48 MB |
| Post-startup heap, 150–360 s | Process already terminated | Bounded at 377–566 MiB |
| Complete startup, separate 6,144 MiB control without profiling | 98.34 s | 93.83 s |
| HTTP listening, same startup control | 50.52 s | 49.56 s |

The larger-heap startup control lets the baseline complete startup rather than comparing a successful candidate against an OOM.

- Real `sessions.catalog.list` Gateway RPCs returned exactly the three expected native session IDs for agents `agent000`, `agent001`, and `agent738`.
- Exact-head live gate: a real OpenAI `gpt-5.4-mini` turn through the candidate Gateway's Codex harness returned `CATALOG_LIVE_OK` on the 739-agent profile (5.449 s). Its temporary read-only credential file and container were removed.
- Regression failed on baseline: four fleet config clones instead of one across multiple agents/homes. It passes on the candidate and also checks reload allocation isolation; the regression itself took 5 ms.
- All 38 focused tests passed across `session-catalog-listing-cache.test.ts`, `session-catalog-request-lifetime.test.ts`, `session-catalog-homes.test.ts`, and `session-catalog-backoff.test.ts` (38.67 s wall).
- Standalone `pnpm test extensions/codex/src/session-catalog-listing-cache.test.ts --maxWorkers=1` passed (32.61 s wall, including runner preparation).
- Built and exercised the real candidate runtime with `pnpm build`. Broader static and project-wide validation is left to CI.

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit fd01246)

* fix(telegram): preserve queued preview writer authority (#160137)

* fix(telegram): preserve queued preview writer authority

Forward-port the Telegram preview correction from f488a8c. Both preview paths retain current-writer authority through the account scheduler and network admission.

WIP: the regression failed before the repair and all 86 focused tests pass. Full changed-check completion and independent review remain pending under the work-order time budget.

Co-authored-by: Ayaan Zaidi <[email protected]>

* docs(telegram): scope the preview authority note to guarded updates

---------

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit a8907e3)

* fix(telegram): keep empty binding archive failures from blocking updates (#162290)

Follow-up to #161832: when archiving a verified-empty retired Telegram bindings file fails (for example the .migrated target already exists), the migration records a recoverable warning instead of refusing the update; non-empty or uncertain sources keep the preservation refusal. Sanitized refusal messages keep their diagnostic text.

Refs #161795

Thanks @ericcaiwx-star for the base fix in #161832.

(cherry picked from commit 1b9d7e7)

* fix(sandbox): sessions fail with EACCES after skills refresh on read-only installs (#162304)

* fix(sandbox): keep synced skill copies removable on read-only installs

Sandbox skill sync copied bundled skills with fs.cp, which keeps source
modes. From a read-only install every copied directory became 0555, so the
next full re-sync (skills version bump or Gateway restart) failed with
EACCES unlinking skills/<skill>/SKILL.md, and library-pinned sessions
failed every turn.

Copied directories are now made owner-writable (file modes unchanged), and
removal repairs legacy read-only trees inside the synced child before one
retry. The repair stays inside the skills root and never follows symlinks.
The Claude CLI skills-plugin copy fallback uses the same helper.

* fix(sandbox): classify skill removal errors without a type assertion

(cherry picked from commit be93e85)

* fix(doctor): share plugin registries across agents in the tool-schema check (#162394)

doctor --fix heap-OOMed on a 739-agent state: the runtime tool-schema check resolved a model per agent workspace, and every plugin-load cache context cloned the full runtime config and retained a registry per workspace (516 MB of config clones at 2.4 GB heap). The loader now defers config capture until a cache miss and shares prepared provider registrations within a captured config generation for agents with matching configuration and plugin sources; a reentrant load during capture joins the in-flight load instead of registering twice. 300 synthetic agents: config clones 1,802 -> 3, registries 300 -> 1, peak RSS 1.25 GB -> 0.88 GB.

Closes #161869

(cherry picked from commit e304e4f)

---------

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Vito Cappello <[email protected]>
Co-authored-by: VACInc <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
Co-authored-by: Eric Cai <[email protected]>
RomneyDa added a commit that referenced this pull request Oct 1, 2026
* fix: preserve plugin settings through update recovery (#160344)

Keep incompatible local plugin configuration intact and complete deferred migration confirmation after unchanged package convergence. Use completion receipts to clear obsolete retry warnings without rewriting update history.

Fixes #159477. Thanks @EndeavorPioneer for the recovery report.

(cherry picked from commit 8e66b0b)

* fix: prevent duplicate Gateways during container onboarding (#160193)

* fix: prevent duplicate Gateways during container onboarding

* fix: keep QA cron controls scoped to the child

Drop inherited parent cron suppression while preserving explicit child runtime
settings. Cover the failing inheritance contract at the environment owner.

Await node-list RPC responses after acknowledged rename and reconnect events
without racing the existing RPC deadline against a separate polling timeout.

(cherry picked from commit 54b1b1b)

* fix: refuse incompatible Windows 9.4 schema upgrades (#160718)

* fix: refuse incompatible Windows 9.4 schema upgrades

Refuse shared-state migration during the shipped Windows 9.4 raw Doctor preflight while its recorded updater drivers have not positively stopped. Keep the existing delegated Doctor and 9.2 publication paths unchanged. Split manual recovery text so the shipped canary retains the reason and commands within its per-line capture limit. This contains the old callback failure; it does not complete automatic 9.4 updates.

* fix: refuse legacy Windows migration during package staging

* fix(update): load package lifecycle guard only at runtime

(cherry picked from commit 0703c21)

* fix(anthropic): prevent stuck turns after background Bash completes (#161260)

* fix(anthropic): release backgrounded Bash hold on task-notification result

* fix(anthropic): settle background replies without stalled or prematurely closed turns

Keep native Bash, agent, and workflow completions attached until consumed. Correlate queued and inline acknowledgements, preserve failure retirement, and distinguish automatic Bash timeouts from explicit background requests using authorized input. Add transport regressions; verify real Claude producer ordering and patched warm-session reuse.

Co-authored-by: VACInc <[email protected]>

---------

Co-authored-by: VACInc <[email protected]>
(cherry picked from commit 38dd3c2)

* fix: preserve maintenance leases during SQLite contention (#160702)

(cherry picked from commit 3328283)

* fix(gateway): preserve proxy policy in local TLS health probes (#161946)

(cherry picked from commit 649b19f)

* fix(telegram): prevent empty retired bindings from blocking updates (#161832)

* test(telegram): cover empty retired bindings migration

* test(doctor): cover empty Telegram migration receipt

* fix(telegram): archive verified empty retired bindings

Co-authored-by: ericcaiwx-star <[email protected]>
(cherry picked from commit 646ac9a)

* fix(doctor): keep session repair iterative on deep canonical owner chains (#162321)

Doctor's session-repair step overflowed the stack (RangeError: Maximum call stack size exceeded) on large but healthy agent databases during 2026.9.7 update activation: canonical-owner resolution followed canonicalOwnerSessionKey alias chains recursively, and row-count-sized spreads sat on the same path. Resolution is now iterative with the same terminal-owner, missing-owner, and cycle outcomes, and the spreads are linear reductions with unchanged empty-input behavior. A healthy 12,000-owner / 200,000-event fixture fails pre-fix and passes post-fix; the published-driver upgrade preserved transcript bytes.

Closes #161979

(cherry picked from commit 9fb7ba2)

* fix(launcher): keep the Node compile-cache path short on Windows (#162841)

2026.9.7 lengthened the compile-cache marker from <mtime>-<size> to build-<buildId>, which pushed cache paths on Windows into the directory-length window where Node 24's module.enableCompileCache() never returns (nodejs/node#66438); every OpenClaw process start could then spin at full CPU. The shared cache owner now uses a 16-character hash of the full build id as the marker, refuses Windows cache paths over 200 characters with a recorded warning (cache off for that process), and no longer propagates an unsafe inherited cache path to children. Legacy namespace handling and POSIX behavior are unchanged; native Windows/Node 24.18 completes the packaged CLI with a 220-character TEMP in 2.4 s.

Closes #162821

(cherry picked from commit 6e987af)

* fix(codex): prevent Gateway heap exhaustion with large agent fleets (#162912)

Closes #162802

## What Problem This Solves

Fixes Gateway heap exhaustion during Codex session discovery on large agent fleets. Thanks to @609NFT for the report and allocation profiles.

## User Impact

Large fleets can finish startup and retain their native Codex session catalog without retaining a whole fleet configuration for every agent/home pair. No schema, stored-data, configuration, or catalog-output changes are required.

## Why This Change Was Made

The existing config-identity cache now owns one captured configuration per generation. Agent/home entries keep their separate directories and cloned connection options, but share that captured configuration. Config reload isolation and source-specific backoff remain unchanged.

No overlap with Pash/Sarah changes.

Codex source inspection: `codex-rs/app-server/src/request_processors/thread_processor.rs:2524–2608` in the sibling Codex checkout confirms that `thread/list` consumes pagination and filter parameters; the fleet configuration capture being repaired belongs to OpenClaw, not the native listing protocol.

## Evidence

Compared baseline `7ef388bac8f607eb03510189922d1c6a4d786b52` with candidate `f0ae922f60922f2b357bc3d5af22a2142799fbe0` in isolated Linux arm64 Docker containers, Node 24.21.0. The synthetic profile contained 739 agents, eight explicit Codex homes, and three native sessions (380,439 bytes of configuration).

| Check | Baseline | Candidate |
| --- | --- | --- |
| Real Gateway, 2,560 MiB heap | Heap OOM at 100.3 s | Survived the six-minute window; clean shutdown |
| Sampled catalog allocations under `resolveRequestOptions` → `structuredClone` | 2.248 GB | 5.48 MB |
| Post-startup heap, 150–360 s | Process already terminated | Bounded at 377–566 MiB |
| Complete startup, separate 6,144 MiB control without profiling | 98.34 s | 93.83 s |
| HTTP listening, same startup control | 50.52 s | 49.56 s |

The larger-heap startup control lets the baseline complete startup rather than comparing a successful candidate against an OOM.

- Real `sessions.catalog.list` Gateway RPCs returned exactly the three expected native session IDs for agents `agent000`, `agent001`, and `agent738`.
- Exact-head live gate: a real OpenAI `gpt-5.4-mini` turn through the candidate Gateway's Codex harness returned `CATALOG_LIVE_OK` on the 739-agent profile (5.449 s). Its temporary read-only credential file and container were removed.
- Regression failed on baseline: four fleet config clones instead of one across multiple agents/homes. It passes on the candidate and also checks reload allocation isolation; the regression itself took 5 ms.
- All 38 focused tests passed across `session-catalog-listing-cache.test.ts`, `session-catalog-request-lifetime.test.ts`, `session-catalog-homes.test.ts`, and `session-catalog-backoff.test.ts` (38.67 s wall).
- Standalone `pnpm test extensions/codex/src/session-catalog-listing-cache.test.ts --maxWorkers=1` passed (32.61 s wall, including runner preparation).
- Built and exercised the real candidate runtime with `pnpm build`. Broader static and project-wide validation is left to CI.

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit fd01246)

* fix(telegram): preserve queued preview writer authority (#160137)

* fix(telegram): preserve queued preview writer authority

Forward-port the Telegram preview correction from f488a8c. Both preview paths retain current-writer authority through the account scheduler and network admission.

WIP: the regression failed before the repair and all 86 focused tests pass. Full changed-check completion and independent review remain pending under the work-order time budget.

Co-authored-by: Ayaan Zaidi <[email protected]>

* docs(telegram): scope the preview authority note to guarded updates

---------

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit a8907e3)

* fix(telegram): keep empty binding archive failures from blocking updates (#162290)

Follow-up to #161832: when archiving a verified-empty retired Telegram bindings file fails (for example the .migrated target already exists), the migration records a recoverable warning instead of refusing the update; non-empty or uncertain sources keep the preservation refusal. Sanitized refusal messages keep their diagnostic text.

Refs #161795

Thanks @ericcaiwx-star for the base fix in #161832.

(cherry picked from commit 1b9d7e7)

* fix(sandbox): sessions fail with EACCES after skills refresh on read-only installs (#162304)

* fix(sandbox): keep synced skill copies removable on read-only installs

Sandbox skill sync copied bundled skills with fs.cp, which keeps source
modes. From a read-only install every copied directory became 0555, so the
next full re-sync (skills version bump or Gateway restart) failed with
EACCES unlinking skills/<skill>/SKILL.md, and library-pinned sessions
failed every turn.

Copied directories are now made owner-writable (file modes unchanged), and
removal repairs legacy read-only trees inside the synced child before one
retry. The repair stays inside the skills root and never follows symlinks.
The Claude CLI skills-plugin copy fallback uses the same helper.

* fix(sandbox): classify skill removal errors without a type assertion

(cherry picked from commit be93e85)

* fix(doctor): share plugin registries across agents in the tool-schema check (#162394)

doctor --fix heap-OOMed on a 739-agent state: the runtime tool-schema check resolved a model per agent workspace, and every plugin-load cache context cloned the full runtime config and retained a registry per workspace (516 MB of config clones at 2.4 GB heap). The loader now defers config capture until a cache miss and shares prepared provider registrations within a captured config generation for agents with matching configuration and plugin sources; a reentrant load during capture joins the in-flight load instead of registering twice. 300 synthetic agents: config clones 1,802 -> 3, registries 300 -> 1, peak RSS 1.25 GB -> 0.88 GB.

Closes #161869

(cherry picked from commit e304e4f)

* fix(release): carry 2026.9.8 CI exceptions

---------

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Vito Cappello <[email protected]>
Co-authored-by: VACInc <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
Co-authored-by: Eric Cai <[email protected]>
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 merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. 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. scripts Repository scripts 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