Repository navigation
fix: backport release-critical update and session repairs - #163074
Conversation
…RSS) (#161003) * fix(state): keep the state read worker out of the update write graph Move reconciliation inspection and candidate selection into a read-only module shared by the state reader and reconciliation writer. The standalone reader disables code splitting, so its former write-side import also bundled dynamic failure-fact/Doctor imports and the Gateway runtime. At release tip 56fb887, the built worker was 52,186,708 bytes with 9,768 esbuild inputs. After this split it is 3,491,598 bytes with 1,025 inputs, measured with packages external for both input graphs. Keep the read queries, eligibility checks, and transactional reconciliation bodies unchanged. The full build and 95 focused tests pass. * test(state): keep standalone workers out of the Gateway server graph Bundle each standalone entry with esbuild and reject transitive Gateway server, flow, wizard, in-process dispatch, and update-write inputs. Restoring the release-tip reader import and writer exports fails only the state reader with 682 forbidden inputs; the fixed graph passes all nine entries. Validation: pnpm test test/scripts/runtime-process-build-graph.test.ts --maxWorkers=1 (3.67s wall, 0.678s Vitest); negative control 3.732s wall. oxfmt, oxlint, and independent review pass. (cherry picked from commit f2715ed)
Resolve read-only worker launches through the running updater's retained generation. Keep session reuse generation-aware and join child work before retiring its runtime files. This protects future self-updates; an already loaded 2026.9.6 driver retains its first-hop limitation. Refs #161865 (cherry picked from commit f59e979)
) On Windows the managed update swap renamed the live package tree to its backup location once; a transient EPERM/EBUSY/EACCES from an antivirus, indexer, or Scheduled Task handle failed the swap and rolled the update back. The filesystem owner of the swap now retries those codes with bounded backoff (16 attempts), records each retry, re-checks package identity and update authority between attempts, and reports a named failure after the bound. POSIX behavior is unchanged. Refs #162027 (cherry picked from commit b5555b0)
* fix: avoid duplicating SQLite snapshots during update rehearsal * test: target final snapshot publication in race hooks * test: exercise staging cleanup after snapshot transfer * docs: describe row-preserving update rehearsals (cherry picked from commit c77a055)
Co-authored-by: Peter Steinberger <[email protected]> (cherry picked from commit 1129326)
* fix(state): retain publication leases while Gateway drains * perf(state): preserve normal publication close scheduling (cherry picked from commit defb7cf)
…daction scans (#162810) Reduce repeated session-publication allocations and redaction prefilter scans at their lifecycle owners, preserving live recipient authority and byte-identical redaction. Validated with Node 24 and fork Bun tests, authority negative controls, fixture differential checks, pinned AWS kernel and three-round load benchmarks, a clean post-rebase spot quartet, and green exact-head CI. (cherry picked from commit 4e4e315)
snapshotCache in src/agents/shell-snapshot.ts was a process-wide Map that retained one entry per distinct cwd/environment key for the Gateway's lifetime, so long-running Gateways with many sessions grew without bound. The owner now reuses the existing LRU cache with a documented 128-entry limit; the active key stays cached and a miss recomputes. At 201k synthetic keys RSS fell from 265 MiB to 232 MiB and live heap from 74 MiB to 6 MiB. Closes #162582 (cherry picked from commit 24baf01)
(cherry picked from commit 84c6eb8)
(cherry picked from commit 4f0541e)
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed October 2, 2026, 2:41 AM ET / 06:41 UTC (Revision 24). ClawSweeper reviewWhat this changesBackports update, SQLite worker, memory, redaction, and delegated-session repairs into the 2026.9.8 release branch, with migration documentation and regression coverage. Merge readiness⛔ Blocked before merge - 1 item remains This remains a useful release-branch backport. The prior compatibility concern is resolved by maintainer acceptance and matching upgrade evidence; the latest fixture repairs introduce no blocking finding. Priority: P1 Review scores
Verification
How this fits togetherThe updater carries installed packages and existing state through replacement and verification. The Gateway’s session owners coordinate delegated work, publish authorized session views, and deliver completed results. flowchart TD
A[Installed package and existing state] --> B[Update preparation and verification]
B --> C[Package activation]
D[Agent delegation requests] --> E[Session completion owners]
E --> F[Current requester authority]
F --> G[Single reply delivery]
C --> H[Updated Gateway]
Before merge
Agent review detailsSecurityNone. PR surfacePR surface statistics unavailable: the file list is incomplete. Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Carry the verified repairs into the release through the existing update and completion owners, with publication qualified against the final release SHA. Do we have a high-confidence way to reproduce the issue? Not applicable to a new defect: this backport has upstream failing controls and runtime evidence plus exact-head CI; no code or tests were executed during this read-only review. Is this the best way to solve the issue? Yes. Reusing the merged owner-level repairs with release-specific adaptations is appropriate, and the latest fixture changes preserve meaningful assertions. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against fa13650f912f. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (23 earlier review cycles; latest 8 shown)
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Exact-head repair at
Focused proof on this SHA: 51 sessions tests, 42 sessions delivery/admission tests, and 40 SQLite execution tests passed. Formatting, scoped lint, production types, every core-test type shard, and fresh P0–P2 AutoReview are clean. The aggregate changed gate remains stopped only by the PR's pre-existing line-cap drift in unrelated files. |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Current head Exact proof: |
|
🦞👀 Re-review progress:
|
|
CI fixture-isolation repair evidence for |
(cherry picked from commit 4d638fd)
|
@clawsweeper re-review Exact head
Focused proof: catalog performance 1/1 passed in 27.2s; sidebar roster Chromium E2E 1/1 passed in 27.0s; the |
|
🦞👀 Re-review progress:
|
What Problem This Solves
The
2026.9.8release candidate was missing confirmed update, Windows copy, performance, memory, and delegated-work fixes that landed after the release branch cut.User Impact
2026.9.8avoids known update rehearsal/copy failures, excessive state-worker and Codex fleet memory, slow memory-sync shutdown, repeated session/redaction work, unbounded shell snapshot caching, delegated sessions that stop silently or deliver replies twice, and macOS npm updates that reject the standard/vardirectory alias.Why This Change Was Made
Backports the applicable release fixes from #161003, #162076, #162231, #162352, #162403, #162387, #162616, #162810, #162967, #162227, #162567, and the direct Codex fleet-memory follow-up #163129.
The #162227 and #162567 session changes were adapted to the older release-branch owners because later main-only APIs do not exist here. The cumulative audit found and fixed one real adaptation gap: key-only callers now retain the resolved requester session ID and lifecycle revision, matching upstream incarnation fencing without restoring the retired DM-to-main remap. It also restored the publication-authority regression that the adaptation had accidentally removed.
Three candidates are intentionally excluded:
refreshNativeReference; the affected trigger is absent here.@openclaw/fs-safe0.22.0. This release intentionally remains on 0.21.1; replaying the follow-up changed an outside symlink target from mode0444to0400in its own regression. Pulling a new native filesystem dependency into this hotfix would increase risk and requires separate release approval, so the candidate keeps the already-backported fix(sandbox): sessions fail with EACCES after skills refresh on read-only installs #162304 behavior instead.CHANGELOG.mdis intentionally unchanged because the release workflow regenerates it after the product set freezes. The config documentation baseline is included because the delegated-work migration changes the canonical schema.Full Release Validation Diagnostic Drain
The failed FRV parent is https://github.com/openclaw/openclaw/actions/runs/36926596622.
2026.9.8policy mapping.baseline-package-identity.jsonfor generic flows. Main fixed that harness in8ae1e870c1aand99567a65b7c; the next canonicalrelease-ci/transport inherits it./var/folders/...to/private/var/folders/..., while activation compared and recorded raw paths. This PR canonicalizes the complete activation boundary while preserving authority and custody checks. Main is fixed separately by fix(update): canonicalize package activation paths #163086.Cumulative Release Risk
This is not a low-risk one-line hotfix. The release branch also contains the previously merged #162931, #162959, and #162981 backport groups, plus the later GPT-6.1 Sol and llama.cpp Windows-runtime changes. The highest interaction risk is the updater/SQLite group and the adapted session/subagent cutover. The GPT provider and llama Windows changes landed after the prior FRV, so only a fresh exact-final-SHA FRV can qualify the complete release.
The exact final validation must cover the update first hop and survivor paths, all Linux/Windows/macOS install and upgrade cells, packaged Windows llama startup, GPT provider discovery/request routing, and delayed/nested/restarted subagent completion without duplicate delivery. Telegram and Matrix live coverage remains explicitly waived by release policy; this PR does not treat those waivers as positive proof.
Evidence
dcf14386338; the key-only case fails without the restored incarnation fallback.0ea96bc2c594: formatting, line/max-line/assertion ratchets, package-lock/dependency guards, generated baselines, SDK exports/budget, and doctor contracts passed. The sole remaining local red is the date-based plugin compatibility-expiry gate, which also fails unchanged current source with the same overdue records.git diff --checkpassed.Update behavior: the installed updater still runs first. Candidate-side changes consume existing update markers, use native Git directory copies where supported, avoid duplicate SQLite rehearsal copies, retry transient Windows rename locks, retain SQLite workers across package replacement, and canonicalize equivalent POSIX directory aliases before sealing recovery ownership without introducing a new refusal path.
Canonical Full Release Validation follows merge. The release workflow intentionally refuses a pre-merge PR head because a regular release Code SHA must be an ancestor of the canonical
release/2026.9.8branch; a noncanonical direct dispatch would not be reusable release evidence.