Skip to content

perf(sessions): keep cleanup responsive and reuse workers - #140897

Merged
steipete merged 26 commits into
mainfrom
steipete/retention-sweep-followup-20260907
Sep 13, 2026
Merged

steipete merged 26 commits into
mainfrom
steipete/retention-sweep-followup-20260907

Conversation

@steipete

@steipete steipete commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Related: #112423.

What Problem This Solves

Session cleanup repeatedly starts Workers and decodes metadata for unrelated sessions, delaying cleanup and other Gateway work.

User Impact

Cleanup and multi-generation deletion reuse bounded Workers while preserving transcript bytes, current references, retention protections and per-victim archive durability. There are no configuration, schema, protocol, dependency, retention-policy or data-conversion changes. The retained reclamation Worker retires after 60 idle seconds or explicit drainage. Source-runtime measurements show higher immediate process RSS; the observed tradeoff and measurement limits are below.

The measured immediate RSS tradeoff is accepted within the bounded Worker lifecycle described here; sustained memory use on smaller hosts remains uncharacterized, and no broader memory guarantee is claimed. The complete 101-file change list was inspected: there is no new configuration/default, schema, or storage-format surface requiring migration. The completed published 2026.9.4 driver-to-candidate proof supplies the upgrade and restart evidence, including state preservation and lease drainage.

Why This Change Was Made

The existing reclamation owner retains one validated Worker and agent connection per process. Each request still obtains a fresh parent claim and numbered writer admission, rechecks current authority, joins transaction settlement and publishes committed removals before releasing admission. Main's shared worker reservation covers both retained reclamation and one-shot cold mutations, preventing inherited foreground callbacks from borrowing a native Worker's write permit. Main's Gateway-lifetime integrity-verification policy remains with its existing owner; warm replies cannot revive invalidated proof.

Pressure sweeps and explicit deletion reuse one archive Worker within their operation scope. Each archive request closes its fresh read-only database and file handles before reporting completion. At most one archive Worker stays warm across competing scopes, and completion, failures and retirement join native exit. Cold preparation and mutations retain their one-shot lifetime. Single-candidate reference checks narrow JavaScript hydration while preserving fresh SQL reads, canonical parsing and unsafe-text fallback. Startup integrity runs in the existing child against its private snapshot, with asynchronous snapshot cleanup fully awaited.

CPU profiling of the previous candidate exposed redundant store loading and metadata rewriting during cleanup. This three-file repair skips applyStore unless fixMissing or fixDmScope requires it, yields immediately before and after lifecycle application outside the transaction, and reuses the canonical previous entry already read inside the maintenance transaction while copying archive fields. Transaction atomicity and the existing authority, configuration, schema and retention contracts are unchanged. Canonical built SMOKE, SCALE, MASSIVE, and the actual published-updater handoff all pass.

Evidence

Published head: d49a43e01bf8db330560b7a2f1258bcf733b68c5, tree 5c1c8add91580002311d739b58e0368aa1ce13b5, parent 81c77fe8ea8c511ac17d05198a552f971a8af138. All required current-source proof is complete. Fresh CI 34749371482 and the normal Linux build/package passed. Independent build verification matches all 41,983 source files and 11,795 build outputs (package a59a532f8ecd2cc31300a235f843a9a2a09a1e9595181bc07d2861d33386d20c; build digest fb5c26cbf1b24142c8806771ef688702a483ef52983664bee171664cde588d7f). The bounded CPU diagnostic and canonical SMOKE/SCALE/MASSIVE are complete. The actual published 2026.9.4 updater handoff independently passed on the identical accepted build. The canceled first dispatch remains recorded below. The separate labeling job passed on retry after a recorded GitHub 502 response. One CodeQL matrix job stopped during result upload without a source finding in its log; its second attempt passed. Both complete current-head check sets passed or were skipped by their owning workflow, including the platform-ref recovery rerun described below.

The three-file repair passes 66 existing tests across 10 files, including metadata preservation, and all final selected static checks. Independent P0–P2 review is clean. An initial fixture typecheck rejected publicShare on the public SessionEntry type; the fixture was corrected to its actual InternalSessionEntry contract. Typechecking now passes; the runtime test body was unchanged.

The same bounded large-fixture diagnostic recorded a 497.454773 ms maximum gap on d49a43e, compared with 829.190834 ms on 81c77fe. All 512 reads and both load rounds completed; no diagnostic journal gap reached 500 ms. The 2.545227 ms instrumented margin is narrow, and profiling changes overhead, so this is evidence of improvement rather than canonical acceptance. All 57 artifact files are independently bound; CPU profile 3bdf8043ac78d4ebd80be5977c1c777dbbd4aac6967ba885810e7cfda94010a5 was saved before the bounded diagnostic SIGKILL. Archive: 180fac2a7c8bf6bb77a847ff6c05467c85bc39cc16a9cf8937db9bd1ac57ecf5. Canonical SMOKE independently passed in 6.689141049 seconds, with a 402.658848 ms maximum whole-lifetime gap. All 48 archives and protected 52 nodes/54 generations/162 events and identities/68,424 bytes were verified, along with 106 mutation operations, 96 settled archive operations and eight reads per method. Native Worker/Gateway exits, archive exit before cleanup reply, WAL-aware root integrity and zero agent leases pass. SMOKE archive: ddcf733ff1abce02f1c44f66d96618642fa7f9813d4faabb02304349efa4ec69. SCALE independently passed in 934.63459773 seconds (15m34.635s), with a 392.896274 ms maximum whole-lifetime gap. All 9,998 archives, 20,996 mutation operations, 19,996 settled archive operations, 5,002 protected nodes/5,004 generations/15,012 events and identities/6,335,124 bytes, and 128 reads per method were verified. Native exits, archive exit before cleanup reply, root integrity and zero agent leases pass. Archive: 5d2b9536d0fb401cacaa6091290c8482d25a8ff5cd320fd57f45235fbe7d66d9. MASSIVE used a fresh runner with the exact same build because completing capture and verification could not preserve 75 minutes on the original runner. The full transfer included all root outputs, 294 links, and 119 AI workspace outputs; all source/build/package bindings and 16 imports passed independent verification. No workload or lease limit was increased.

MASSIVE independently passed in 3,381.89529259 seconds (56m21.895s), with a 477.837972 ms maximum gap across the complete Gateway lifetime, including native shutdown. All 41,996 mutation operations, 19,998 archives, 10,002 protected nodes/10,004 generations/30,012 events and identities/12,685,132 bytes, and 256 successful reads per method were verified. The archive actor settled 39,996 operations and exited before cleanup replied. Native exits were clean, WAL-aware root integrity passed, and no agent database leases remained. All 46 canonical evidence files bind to archive 5ce9c0bf938f23372b59b733fb94c37ce2c6b77be9463f69b28073d3c8deb110; root verification independently rehashed the complete 54,729,061-byte archive. MASSIVE runner.

Supplemental Linux memory sampling recorded 3,380 samples, a peak sampled RSS of 1,093,352 KiB (about 1.04 GiB), and maximum observed kernel high-water of 1,094,600 KiB. These process values include Worker threads and exclude child processes; samples can miss peaks. The last sample was 360.518 ms before Gateway exit and 311.919 ms before the last Worker exit, so no post-retirement memory claim is made. The accepted MASSIVE runner is stopped. The prepared updater runner was canceled at 10:53:51 UTC for an unknown reason, before the attempted updater dispatch. The provider rejected that dispatch before execution (commandMs: 0); no updater ran. Its failed receipt is preserved. The fresh recovery runner restored the identical accepted build/package/workspace outputs and completed the unchanged fixture. All proof runners are now stopped.

The actual published 2026.9.4 updater handoff independently passed. The original published helper (5d0df7810f699574ece5f211fef43bc7a4858d68bb38cc8ce79d516b593e05a7) consumed the successful update receipt and selected the updated dist/index.js, invoking gateway restart --preserve-definition --json. Two settled reclamation operations and two archive payloads were verified, including one scoped archive actor. The retained Worker was still live when SIGTERM arrived, then settled close, Worker exit, and Gateway exit occurred in order; the last result-to-close interval was 4,312.923069 ms, before idle retirement. Native complete-survivor, main/ops table-hash conservation, lease absence, and configuration-restoration assertions passed. Raw SQLite files were not exported for this updater cell, so its data proof combines native assertions with independent journal/hash verification rather than independent DB recomputation. All 132 artifact files and the unchanged 41,983-source/11,795-build inventories bind to the 7,014,814-byte archive c6504809d034ae97f0666b59d32cb079bc26995f4d0d06cbf2d06b243e4e9e98, which root independently rehashed.

At 10:26 UTC, one bounded close/reopen attempted to refresh a stale GitHub pull-head projection. The named branch and PR metadata remained d49a43e; GitHub still served 81c77fe at refs/pull/140897/head, while its merge preview used the correct candidate. The PR is open, the source is unchanged, and CI 34751839082 passed. Its preflight log records the same merge fc0ad0fa1c85e8b9d32bd142511d55cf5126e12a of d49a43e into main 7ad2d15f9468f77817525f3663cc2e607e97df9a; it does not establish a newer main baseline. No native guard is bypassed. The acquisition-owner repair #146950 landed as 8d04044ab328588fbc3af3e1909f8f05ef686298. Its trusted wrapper successfully acquired the exact d49a43e commit and passed the native review guard while GitHub still served 81c77fe at the pull-head ref. The accepted storage candidate remains unchanged. This separately grouped PR event did not interrupt the runtime proof.

Current d49a43e local source-runtime comparison against the unchanged pinned 55f3e baseline:

Source / operation Time Workers RSS before / sampled peak / return / after drain, MiB
Main, pressure cleanup of 20 histories 165.839 s 60 729.5 / 997.5 / 658.1 / 658.2
Candidate, same logical cleanup 6.801 s 2 709.9 / 1060.0 / 1007.4 / 992.8
Main, delete 20 histories plus current 130.494 s 63 701.0 / 953.1 / 599.6 / 608.3
Candidate, same logical deletion 3.088 s 2 738.5 / 1077.8 / 1065.9 / 1053.7

Only the four new candidate cells were run; the verified baseline evidence is reused unchanged. All within-run archive bytes, survivors and native drainage pass. These are single Node 26.8.2/macOS source-runtime measurements with sampled peaks and no forced GC. Higher candidate RSS remains explicit; these timings neither measure packaged Gateway latency nor establish sustained memory cost or a leak. Earlier measurements remain identified below.

Required sequence: fresh normal build → the same bounded CPU probe to verify the gap repair → canonical SMOKE → SCALE → MASSIVE → actual published 2026.9.4 updater after accepted MASSIVE. The 500 ms whole-Gateway-lifetime bound and 4/30/60-minute workload budgets remain unchanged. Keep the sequence on the same lease when at least 75 minutes remain before MASSIVE, and capture/preserve the complete same-build bytes, including workspace AI outputs; any subsequent lease must use those bytes. Earlier passes, ongoing failed-run forensics and the forced-stop diagnostic below do not establish acceptance of this source.

Historical 81c77fe build/SMOKE/SCALE and local comparison; failed MASSIVE and separate CPU diagnostic

Historical head 81c77fe8ea8c511ac17d05198a552f971a8af138, tree 7a085bd4d6edabc52fe9b04a1f37a6f84b59ec70, normally merged main 55f3e3428a89ee82ccd4992b77895d61405d774d and was verified MERGEABLE. Its normal build/package, SMOKE, SCALE and local source-runtime comparison passed. Its canonical MASSIVE run failed the strict 500 ms responsiveness bound; it completed in 55m51.590s with independently verified conservation and native exits, while retaining its timing failure. The actual published 2026.9.4 updater handoff remained unrun. These earlier-source passes do not establish acceptance of d49a43e.

The fresh Linux build and package checks passed on Node 24.19.0/libuv 1.52.1. First CI 34746247683 tested merge c0870d9a21e8c34f8ecf1729227b841f2f588a6d into main 65c8b06f2e42f4788d45da3b5573a761ddaf58fd and failed three main-owned fixtures: two UI tests imported removed deferred, and agents-other had 702 roots against 700. This PR changed neither UI nor shard classification and added no agent test roots; #146803 and #146862 supplied the main repairs. Follow-up CI 34748192644 recorded zero-step failures in large-6, large-10 and small-10; their logs returned 404. These are not code findings, and that run's final outcome remained pending at this checkpoint. Neither CI failure is represented as passing evidence. The source-runtime timing/RSS/conservation comparison against pinned main 55f3e3428a89ee82ccd4992b77895d61405d774d passed as recorded below.

81c77fe passed 177 affected integration tests across 15 files, plus 11 admission tests across two files. Selected changed checks—including types, production/full-tree export scans, lint and guards—passed. Full-candidate P0–P2 review and the final review of main's admission-hook integration were clean. That conflict resolution preserved both main's schema-only Worker and this change's startup integrity snapshot Worker. Main's regression was migrated off the retired one-shot hook while retaining the same data and publication assertions.

Historical 81c77fe independent proof: all 41,983 source files matched the frozen checkout; 11,796 build outputs were sealed (build digest 466ef83e57e78af18cbb9e3e9d0549165f22f58228ae88f5ececaef507780570, package e2bf8a54d37ab2aa49904fc3ed3e8b425776acd138e5eb8dd52f9271126aded9). SMOKE passed in 6.560913732 seconds with a 403.812984 ms maximum whole-lifetime gap. Both independent verifiers confirmed 48 archives, 106 mutation operations, 96 settled archive operations, 52 protected nodes/54 generations/162 events and identities/68,424 transcript bytes, and eight reads per method. All five Workers exited cleanly; the archive actor exited before cleanup returned. WAL-aware root integrity passed with zero agent database leases. SMOKE archive: 5aff1ea049a1aec981b8e3e48a34ac7dba353f7a29856062834d7ec0454591bd.

SCALE also passed both independent verifiers: 929.492709877 seconds (15m29.493s), 406.799081 ms maximum gap including native shutdown, 20,996 mutation operations and all 9,998 archives verified. It preserved 5,002 nodes, 5,004 generations, 15,012 events and identities, and 6,335,124 protected bytes, with 128 successful reads per method. The archive actor completed 19,996 settled operations and exited before cleanup returned; native Gateway exit was 0. WAL-aware root integrity passed with zero agent database leases. Archive SHA-256: 5d264fc220ceabf629b9330e1beab89a228957b2c44897d51553647337954960. A nonfatal wrapper portal-sync warning remains preserved separately; the actual workload/native exit and complete archived evidence passed verification.

Historical 81c77fe versus pinned main 55f3e, Node 26.8.2/macOS source runtime, one measured cell per operation:

Source / operation Time Workers RSS before / sampled peak / return / after drain, MiB
Main, pressure cleanup of 20 histories 165.839 s 60 729.5 / 997.5 / 658.1 / 658.2
Candidate, same logical cleanup 4.300 s 2 697.7 / 1035.0 / 1002.0 / 990.0
Main, delete 20 histories plus current 130.494 s 63 701.0 / 953.1 / 599.6 / 608.3
Candidate, same logical deletion 3.327 s 2 712.8 / 1050.0 / 1036.9 / 1024.7

All eight measurement/conservation cells passed. Separate untimed cells verified each run's own original archive bytes and survivors; all Workers and fixtures closed after native drainage. The 81c77fe candidate kept one reclamation Worker at API return and had higher observed RSS in both workloads. No forced GC was used: immediate RSS does not isolate retained-connection cost or establish a leak. An external native sampler includes Worker threads; peaks are sampled. These single source-loader-inclusive local measurements do not replace packaged Gateway latency or Linux stress acceptance. Historical measurements remain unchanged below.

81c77fe canonical MASSIVE failed strict responsiveness: the heartbeat stream records a 664.790468 ms gap at 9.584885–10.249676 seconds, above the unchanged 500 ms whole-Gateway limit. The run completed in 3,351.589908575 seconds (55m51.590s) with 41,996 reclamation operations, all 19,998 archives verified, 10,002 protected nodes/10,004 generations/30,012 events and identities/12,685,132 bytes conserved, and 256 successful reads per method. The archive actor settled 39,996 operations and exited before cleanup returned; Gateway and Workers exited cleanly, WAL-aware root integrity passed, and no agent database leases remained. The sole native failure was the unchanged 500 ms responsiveness criterion. Archive 153199711dc6d00a65769cad86a459fe15110c298c2a3984a223a9b80c6f5ac6 binds the complete evidence and original live gap excerpt. Supplemental RSS had 3,349 samples, a sampled peak of 1,689,248 KiB and observed kernel high-water of 1,689,400 KiB (about 1.61 GiB). Its final sample was 505.663 ms before Gateway exit and 438.116 ms before the last Worker exit: no post-retirement memory claim is made. The old lease is stopped. The timing failure prevents acceptance. The updater handoff is held. This remains distinct from the preparation-only failures on older sources below.

A separate bounded CPU diagnostic on 81c77fe reproduced an 829.190834 ms gap at approximately 9.504–10.333 seconds. Inclusive timings were 403.485 ms in the transaction (including 322.705 ms in writeSessionEntry), 188.964 ms loading the cleanup store, 96.713 ms in response handling (including 91.687 ms in WebSocket logging), and 33.4 ms in GC. These are inclusive profile observations; nested costs are not additive and do not form an exclusive decomposition of the gap. The profile was saved before the diagnostic SIGKILL. Its 55 files / 11,319 samples are preserved: archive SHA-256 4dff7b30405908641533c2b8faf3896589da456be716f2e0d7ce2a6a21502c8a; profile SHA-256 d92c36ceff325206a52f1b4f1931bec9ba6d72a52a3fbce1996f346aebbc02c7. This diagnostic is attribution evidence, not acceptance, and its forced stop is separate from the unchanged canonical MASSIVE run.

Historical d1b3859 build/SMOKE/SCALE passes, unaccepted MASSIVE attempts and preceding checkpoints

Historical head d1b3859216a4895f99224b263adb7da9f3b905c4, tree af13c0b84e2ec5d932832565676c488800cd7225, passed CI, its normal Linux build, SMOKE and SCALE. Main then introduced a preflight import/type conflict; the replacement head above resolves the normal merge of 55f3e3428a89ee82ccd4992b77895d61405d774d. Neither MASSIVE nor the actual published 2026.9.4 updater handoff was accepted on d1b3859. Its results remain exact-source historical evidence, with the 500 ms bound and 4/30/60-minute budgets unchanged.

d1b3859 preserved the retained-worker ancestry and added the write-owner classification to both mutation paths. A real borrowed-handle foreground write entered before cold Worker authorization without that classification; the regression failed there and passed with it. Main's trajectory regression was retained as covering evidence. The preceding 8abaa5e aggregate passed 524 cases across 27 files, with one existing platform skip. Final test reorganization passed all 33 cold-storage/admission cases across three files; the moved regression and shared seed/snapshot bodies retained their assertions. All selected types, formatting, lint, schema/dependency/ownership guards passed, with zero runtime import cycles. Independent P0–P2 full-candidate and final test-layout reviews were clean. The initial static pass caught a test line limit and callback shadowing; both were repaired through fixture sharing and renaming, with no production or policy change.

Historical d1b3859 built proof: the normal Linux build/package passed on Node 24.19.0/libuv 1.52.1. All 41,903 source hashes matched, and all 11,750 build outputs were sealed (build inventory de050d1b5846149ee670e9a6515d9b50143b194f90d7a78491d0eedda75076d2; package eec4317ed592da1b6a0616fe448f6b99c375554e0fb19b3087afafdce7848931). Testbox run. SMOKE passed both independent verifiers: 6.831475454 seconds, 416.257583 ms maximum whole-lifetime gap, 48 archives, five Workers and native exit 0. It preserved 52 nodes, 54 generations, 162 events/identities and 68,424 protected bytes, completed eight reads per method, and left no agent leases. The archive actor completed 96 contiguous settled operations and exited before cleanup returned. SMOKE archive SHA-256: 06c5c9c4881750cf8f95fd431a67cfad98ab7d9eb9a6cea9ffcc6154bd59423f. The SCALE result and two unaccepted MASSIVE preparation attempts are recorded below; no updater acceptance followed on this source.

SCALE also passed both independent verifiers: 920.582444176 seconds (15m21s), 409.851529 ms maximum gap, 20,996 reclamations and all 9,998 archives verified. It preserved 5,002 nodes, 5,004 generations, 15,012 events/identities and 6,335,124 protected bytes, with 128 successful reads per method. Five Workers were observed; the archive actor completed 19,996 contiguous settled operations and exited before cleanup returned. Native Gateway exit was 0, WAL-aware root integrity passed and no agent leases remained. Archive SHA-256: 430c603a88d780056750fc84083740cd2e12567b3093182715b01e7ce42e5c7c. The subsequent MASSIVE preparation used a fresh lease and a root-dist transfer; the omitted workspace-output failure is recorded below. The full 60-minute budget and updater margin were not relaxed.

The first MASSIVE attempt on the transferred build stopped during preparation before Gateway spawn: the source checkout's workspace link resolved to missing packages/ai/dist. It produced zero Gateway ticks and no Gateway timing result; failure archive d5fa31ce8c5f661b01ed017961ade1b66b8887ba9d818a3b4f50162d429f2145 is preserved. The complete root dist transfer had omitted this separate workspace output. The same sealed package contained all 119 AI runtime-output files. Those exact bytes were restored and all 16 runtime import checks passed independent verification, without rebuilding or changing source, canonical harness or budgets. The subsequent attempt did not produce accepted MASSIVE evidence, as recorded next.

MASSIVE attempt 2 was deliberately interrupted during canonical SDK preparation when GitHub reported the new main conflict. One dispatcher SIGINT and then one exact runner-group SIGINT prevented delayed Gateway startup; no SIGKILL was used. It produced no Gateway journals/ticks or timing result, and the RSS supplement correctly records zero samples with null maxima. Archive baba8c222df8a0760bb210142e90018ee53f3256e7b1a9aa0ca5e4a5ae80b917 preserves all 31 regular evidence files, including the intermediate exit 1/runner -2 and final terminal 130/finalization-interruption record. This was an owner interruption, not a runtime failure or acceptance. All held proof leases for this source were stopped; MASSIVE and updater acceptance were not obtained. The replacement validation schedule is stated above.

d1b3859 passed 191 affected integration cases across 15 files, with one existing platform skip, all selected changed checks and the exact production/full-tree dependency scan. Independent full-candidate P0–P2 review was clean. The earlier 8abaa5e CI finished with only an obsolete resource-registration re-export failure and its aggregate gate. Main's removal of an opaque startup namespace import exposed that otherwise test-only export; d1b3859 included that main integration, deleted the obsolete export and imported its resource owner directly in the verifier test. No analyzer/configuration exemption was used.

Historical 8abaa5e completed a normal Linux build and package verification (run https://github.com/openclaw/openclaw/actions/runs/34739344137), package SHA-256 df3c0a66130491061a43020f1849256195ab3aa265cc3e8b43cfbb093168c17a, build evidence 8dc110efb0a1a6e5cfae7d8db4f5952004935851d9fe2774daee3934b3c274ed. No Gateway profiles ran on that head before the export repair; its lease was stopped.

The previous 676e760f15a48bacf1a124e587409a3ae193e61b candidate independently passed its normal Linux build, SMOKE and SCALE on Node 24.19.0/libuv 1.52.1. SMOKE completed in 6.523137376 seconds, maximum whole-lifetime gap 394.895383 ms, with 48 verified archives. SCALE completed in 934.833658972 seconds (15m35s), maximum gap 412.042212 ms, with 20,996 reclamation operations and all 9,998 archives verified. It preserved 5,002 nodes, 5,004 generations, 15,012 events/identities and 6,335,124 protected bytes; both 64-client read rounds passed, five Workers exited cleanly, WAL-aware integrity passed and no agent leases remained. MASSIVE and updater did not run on that source; its lease was stopped. This remains historical exact-source evidence, not acceptance of the replacement.

Historical build/profile run: https://github.com/openclaw/openclaw/actions/runs/34735652746. Build package SHA-256 d632499d17f1aa97405163f0c50417f5e4861dd00dbb57e4771db3e940e2f511; SMOKE archive e1e26ecea2d271ac8a8650c5f52bf7cf3b96ae72836ca9000365f21ae3283adf; SCALE archive 4fba2112330341026f140f3adabbd1b8ecb4661db99fd1dd8c3d738d52435292.

Historical d1b3859 versus pinned main 3dfa9b2 (which includes Gateway-lifetime integrity reuse), Node 26.8.2/macOS source runtime, one measured cell per operation:

Source / operation Time Workers created RSS before / sampled peak / return / after drain, MiB
Main, 20-history pressure cleanup 155.494 s 60 605.3 / 875.5 / 623.9 / 623.9
Candidate, same logical cleanup 3.821 s 2 701.8 / 1042.7 / 1029.3 / 1017.2
Main, delete 20 histories plus current 239.916 s 63 699.8 / 978.7 / 562.5 / 571.6
Candidate, same logical deletion 3.490 s 2 700.2 / 1047.7 / 1038.9 / 1027.4

In this d1b3859 comparison, the candidate was faster with higher observed RSS. One reclamation Worker remained at API return; all Workers closed after native drain. No forced GC was used, so these immediate snapshots do not establish a leak or isolate the retained connection's memory cost. An external native sampler measures process RSS, including Worker threads, without relying on the target event loop; peaks are sampled. These source-loader-inclusive runs are not packaged Gateway latency or Linux stress acceptance. Separate untimed conservation cells validate all 20/21 archives against each run's own original transcript bytes, preserve survivors and clean fixtures. Independent fixtures contain different generated IDs/timestamps; cross-variant byte identity is not claimed.

Earlier CI ran against a stale merge and exposed unrelated main type/lint failures, followed by a manual run with unrelated UI/tooling failures. Refreshing the PR merge subsequently exposed the preflight import/type conflict resolved in the replacement head above. No failed or incomplete run is counted as acceptance. Earlier failed performance observations and their verified partial conservation remain preserved below.

Historical 9b7e8da642c9b809c09a9e19af6affaf7dbbccf7 passed its normal Linux build and SMOKE in 6.994026408 seconds with a 421.062912 ms maximum gap, five Workers and 48 verified archives, but CI found a type-only import cycle and an eviction/retirement fixture mismatch. Those were repaired in 676e760; SCALE did not run on 9b7e8da. Its SMOKE archive is 4aaf6666b97eeb32d5392a338758c61a09b3a412aacdb5cb5bd3316a5884dec9, run https://github.com/openclaw/openclaw/actions/runs/34734220480. The 676e760 normal CI run https://github.com/openclaw/openclaw/actions/runs/34735597357 used stale merge dd5c00a69ef919dbb6ffa52bc5317eef605f0bfc; its type/lint failures came from an unrelated main import subsequently fixed by #146689. Manual run https://github.com/openclaw/openclaw/actions/runs/34736316447 also used stale comparisons in some jobs and reported dashboard iframe, SDK heap and upgrade-survivor baseline failures. These are recorded failures, not passing proof for any replacement.

Historical acceptance runs, failures and immutable evidence

Results apply only to their named sources, never the current candidate. Required limits remain 500 ms over the complete Gateway lifetime and 4/30/60 minutes for SMOKE/SCALE/MASSIVE. Canonical archived/fresh/active-target counts are 50/60/50, 10,000/6,000/5,000, 20,000/12,000/10,000, with 4/64/128 clients, two rounds. Current-source acceptance still requires the actual published 2026.9.4 updater restart handoff, independently verified conservation/lifetimes. None of the older checkpoints in this block ran MASSIVE.

Context: #112423; accepted design; integrity owner #146512; merged retention #136639 and offline CLI cleanup #144232. No closure of saturation report #127970 is claimed. Exact seals are listed below.

Canonical ccdd7bb and b9380a4: SMOKE passed; SCALE failed

Linux Node 24.19.0/libuv 1.52.1; unchanged source/build inventories. Both SMOKEs completed cleanup/no-op repeat, 106 reclamations on one retained Worker, 48 verified archives, orderly Worker close and native Gateway exit 0. Both preserved 52 nodes / 54 generations / 162 events and identities / 68,424 transcript bytes, with eight successful reads per method, no observer/evaluator errors and zero captured WAL.

Source identity Build / CI SMOKE lifetime / maximum gap
ccdd7bbad85f71b5219b5ee11a5176cf5dd221c1; tree 10f184497d123d200e56016c6e1a0741e62039ac Build: 41,833 source hashes / 11,718 sealed outputs; CI passed 16.176669512 s / 437.399547 ms; pass
b9380a4e811c1e773beb9c5c5c7bb5e0f6775620; tree 011e699008132711011bcae3b4da6a71708a05b7; main through d569fcd 41,797 hashes / 11,725 outputs; carrier 22957cfb748759441033c39669147938ac10d143; Windows/Docker CI passed 18.595280751 s / 426.964327 ms; pass; 1,516 ticks

ccdd7bb SCALE: deadline failure, 1,800.054594531 s / 463.565112-ms maximum gap. Both 64-client rounds passed; 6,135 reclamations/payloads, 12,273 Workers observed. Watchdog SIGKILL interrupted first cleanup; repeat cleanup/orderly shutdown did not pass. Independent reconciliation: 16,000 nodes / 19,865 generations / 59,595 events and identities; 78,000 = 18,405 archived/pruned + 59,595 remaining events. All payloads and materialize→commit→publish ordering, protected 5,002 nodes / 5,004 transcript metadata records, remaining history hashes and SQLite integrity passed. Two root leases remained after SIGKILL: partial conservation only.

Its archive interval spent 1,148.17/1,791.28 s in materialization/publication Worker lifetimes (bootstrap plus SQL/file work, not bootstrap self-time). Medians: 93.43/90.26 ms, reclamation admission→settlement 54.16 ms, inter-victim 48.06 ms; measured before scoped archive execution/reference narrowing.

b9380a4 SCALE: timing failure; stopped at 710.062 s. Gaps ~674/560/1,230/876 ms at relative 1,466.931–2,141.129, 2,636.101–3,195.752, 6,806.101–8,035.853, 8,068.089–8,944.391 ms; readiness 6,043.428 ms, first retained admission 9,684.550 ms (after all four). Both read rounds completed. SIGTERM closed admission but cleanup persisted; exact-PID SIGKILL ended it. DB/WAL/journals/both signal receipts survived. Forensics verified 1,890 archives, protected 5,002 nodes / 5,004 metadata sets, surviving hashes and SQLite/FK integrity. Remaining: 16,000 nodes / 24,110 generations / 72,330 events and identities; 78,000 = 5,670 reclaimed + 72,330 remaining. No completed cleanup/graceful shutdown; updater revalidation pending, MASSIVE blocked.

Separate b9380a4 16,000-session CPU diagnostic reproduced four stalls: bootstrap integrity/FK ~280/261 ms; cleanup lstat/realpath ~875/801 ms. Profile saved before bounded forced diagnostic stop; not acceptance. Separate stale-temp-only source microbenchmark: 3.556 s→0.746 ms, not Gateway lifetime/completed cleanup.

7ccf361b: published update passed; canonical SMOKE timing failed

Source 7ccf361b, tree 2e43ab0ca8127d32f5b6076e9473274ea62d2dff: normal Linux build/package passed, Node 24.19.0/libuv 1.52.1, 41,762 source hashes / 11,714 outputs, unchanged inventories.

Published 2026.9.4→7ccf361 restart handoff passed. Unchanged SHA-verified runUpdatedInstallGatewayCommand consumed the real successful receipt/result.root; passive observation confirmed updated dist/index.js gateway restart --preserve-definition --json. Preserved 4,800 sessions / 23,890 events / 2,200 cron jobs; checked eight conversations/two agents and independently decoded/hashed both historical archives. A retained Worker completed operations 1/2, remained live at SIGTERM, then settled close→Worker exit 0→Gateway exit 0. Close 4,529 ms after last result preceded 60-second idle retirement. Native complete-row node/window/event hashes, leases, survivors and config/service-environment restoration passed. Raw DBs were not exported: native assertions plus independent journal/hash checks, not forensic DB recomputation.

Earlier attempts were not passes: old CLI against new agent-runtimes plugin metadata failed validation; corrected fixture used actual updater delegation, no schema workaround. Earlier service-home, zero-Worker, evidence-directory fixture failures and interrupted build remain incomplete/diagnostic; no separate identities/hashes were supplied for them.

Corrected canonical SMOKE: functional completion, startup timing failure. SDK-writer seed 110 nodes / 160 windows / 480 events and identities passed validity/classification/identity/projection with no pending validation/rebuild. Both rounds/cleanup/no-op repeat completed; one Worker/106 operations, orderly retirement. Final 52 nodes / 54 windows / 162 events and identities / 54 generations / 108 active and FTS rows, integrity OK. Lifetime 19.142479177 s, gap 512.451462 ms at 4,596.416–5,108.867 ms, before readiness 5,119.435 ms and cleanup 5,163.668 ms. No rebuild; no established reclamation-latency attribution. Separate CPU diagnostic: 563.446-ms pre-ready gap, ESM compilation/linking through shutdown/core imports. Evaluator's initial rejection of another Worker's legitimate null ack was fixed and replayed against the same immutable artifacts; original timing failure remained, no acceptance rerun/exclusion. SCALE/MASSIVE did not advance.

997baafd: development measurements and invalid canonical fixtures

Source 997baafd, tree d918f6fc59a9e37f234f0cb32871c853eddebf07. Four sequential reclamations on the same 126,939,136-byte synthetic DB (macOS/Node 26.8.2 source loader): baseline→retained Workers/full scans 4/4→1/1, total 10.028→3.374 s, later operations 2.46–2.77 s→5.65–7.62 ms, 10-ms-sampled peak RSS 1,061,978,112→1,124,204,544 B, post-op RSS 743,243,776→1,126,088,704 B, sampled main-loop delay 96.73→50.59 ms. Both preserved 512 survivor events and joined Workers. Memory-tradeoff evidence, not capacity/whole-Gateway latency.

  • Raw-fixture SMOKE passed its diagnostic validator/recomputation, not canonical acceptance: 18.056 s / 478.925 ms, one Worker/106 operations, settled close/native exit 0; 48 verified archives, 52 rows / 108 events / 53,810 history bytes, eight overlapping reads per method, no-op repeat. Independent immutable-SQLite/journal/zstd/hash checks passed.
  • Raw-fixture SCALE failed timing/deadline: 1,800.067314811 s / 13,029.295231 ms, readiness 250.6 s; both 64-client rounds; Worker 4/4,323 operations and verified payloads. Thirty-minute boundary force-killed Gateway, no orderly retirement/completed sweep. Actual rows 16,000, not the 5,002 expected target. No canonical acceptance/production root cause; MASSIVE not run. All raw samples retained.

Canonical-writer audit found missing transcript identities/header-parent/leaf IDs, group/chat type, mutation/observation clocks, delivery metadata and entry projections/validation state. Recorded raw results remain diagnostic only; validation flags cannot legitimize unchecked state. This fresh fixture was not reconstructed historical V3.4; that original rig archive remained unrecovered.

f8d32e: reconstructed SMOKE failed; bounded resource probe passed

Source f8d32e0302d7cc59cc3ee9f6571204e1a71d185b, tree 1c17340e30abf03e224ec7b1253d22ff684b90e9, base bf630269dbf8c0821885a46c0a58ca33aba1d1a0: CI including Windows passed. Conflict-only refresh preserved 24 task source surfaces; product review P0-only, not performance approval.

Rig: 9/13 original files recovered exactly; maintainer approved the four-file fixture/live-flow/UI-flow/TS reconstruction, reviewed P2. New equivalent, not recovered V2. Bounded identity/post-ack-validation/failed-scope/native-exit census repairs retained unique terminal records, cold-operation-0 exclusion, original files, workload, timing and immediate-crash ordering. Bounded rig checks were not stress acceptance.

Reconstructed SMOKE failed timing, run 34679133549: attested install/build/typecheck/lifetime selftests, Linux Node 24.19.0/libuv 1.52.1, pnpm 12.3.4/original browser inventory. Flow 46.077 s, cleanup 21.617 s; 67 generations + 19 cap archives, protected 30 nodes / 60 generations / 300 events, exact conservation/integrity/no-op repeat/restoration/reply/restart/immediate crash recovery passed; reclamation census settled. Four valid journals: five >500-ms gaps—3,624.425617 ms (Control UI), 921.734262, 866.691791, 875.581039, 888.160148 ms; native 3,626 ms. Bootstrap-first-tick 368–387 ms does not excuse later stalls. Natural exit 1, failed timing/cleanup fields preserved; no larger advance. 27,957,393-byte archive verified before lease retirement. Seven screenshots/every frame of 8.88-s video inspected but withheld for visible Discord invitation card; future captures require canonical dismissal.

V34 resource probe failed: expected helpers gone before fixture exit; historical PIDs remain unidentified. V35 used bounded executable/start identity (no argv/env) and existing post-exit supervisor; lingering-descendant regression failed despite leader exit 0. No new thresholds: 120,000-ms case bound; 5,000/5,000/25-ms cleanup defaults.

V35 passed, run 34690272957, same f8d32e source/tree, Linux Node 24.19.0/libuv 1.52.1/pnpm 12.3.4; carrier 1efadc9ffc50e77131602e5067aedb7e08c9f48e. Source bytes/modes unchanged throughout install/probe. 22 victims / 11 Workers / three strict joins; two victims per retained Worker, globally serialized. Second-wave samples:

Stores / Workers / parent connections Agent leases / borrows / SQLite FDs RSS KiB
1 / 1 / 1 2 / 0 / 11 841,420
2 / 2 / 2 4 / 0 / 19 1,153,964
8 / 8 / 8 16 / 0 / 67 3,154,656

After cleanup all measured resources were zero, shared connection closed, fixtures exit 0/no signal and supervised termination needed no forced-success cleanup; authority/settlement/retirement assertions passed. Limits: empty transcripts/source Workers, not Gateway/pressure/archives/throughput/peak memory/capacity; RSS includes loader/compiler/observer. Worker connection/claim counts 1/2/8 are source-derived, not enumerated; FDs are handles. Observed helpers were esbuild; later observations partly unavailable; zombie-only groups mean terminated, not reaped. 220,990 B / 44 files + manifest verified before lease stop; status completed. Gateway timing still failed.

September 7 and earlier failures

September 7 dc3e79e789748f29a4bfd6212ddbf8a3ae49e2bf, main e136a5cc1c03c3e1148291520f9dfaacb667ca27: Linux x64 Node 24.19.0/libuv 1.52.1; original pinned binaries, entrypoint/probes/workloads/crash ordering/limits unchanged.

  • Original SMOKE failed: cleanup 22.444211 s, 67 generations/19 cap archives reclaimed; protected 30/60/300 nodes/generations/events, exact conservation/integrity/FKs/entry validity, no-op repeat/restoration/reply passed. Four valid journals: nine pre-ready gaps / 767.089561-ms maximum; native 695.2 ms. Fixture stayed alive; 255-s outer timeout (240-s success + failure-only rescue), exit 143. Empty groups/census verified only after intervention, not natural termination; failed fields/cleanupComplete=false retained.
  • V2 SMOKE still failed timing: same source, only terminal ownership/evidence handling changed. Cleanup 17.321954 s, same reclamation/protected conservation, integrity/restoration/reply/no-op repeat passed. Natural exit 1, ~38.7 s, terminal owner complete/groups empty, no forced stop. Four journals: five pre-ready gaps / 526.885920 ms. Native threshold passed (75 samples / 451.7 ms) but interval-coverage acceptance unset. Failed fields/cleanupComplete=false preserved. Disposable copy: 63 nodes / 93 generations / 467 events, integrity OK/FKs zero; 1,251 files / 38,951,695 B verified. Faster cleanup is same-source observation, not caused by later teardown.
  • V2 SCALE failed deadline/timing: first dispatch stopped at unchanged disk guard before remote execution; space recovered without cache deletion/guard change; one inspected recovery ran. Install/build/typecheck/11 lifetime selftests passed. Retention/high-water/128 messages, archive lookup/restoration/reply/restart/immediate crash recovery completed. Retention 16,017 nodes / 32,034 generations / 160,170 events, active 6,017→5,000; separate 5,499→5,500→5,000, excluding 500 old archives. Cleanup >30 minutes; no completed sweep/final conservation. Valid generations 1–3: 8 pre-ready + 18 post-ready gaps / 1,928.156990 ms; native 1,928.3 ms. Generation 4 invalid: unbracketed SIGKILL at deadline. Failed fields/cleanupComplete=false preserved; terminal owner refused destructive retirement. Groups/census empty after settlement, but lease ended before stopped-store inspection: no remaining-victim or post-timeout DB claim. Actions job canceled, cause unestablished.

Original SMOKE omitted terminal cleanup(), leaving an idle TCP reservation: a sufficient exit blocker, not proven sole handle or timing cause. V2 preserved/verified evidence before cleanup, scrubbed both config locations; normal archives omit raw config. Per run: both archives/stable source-build-dependency-runtime inventories verified; seven screenshots/SMOKE, nine/SCALE (50-row windows not full counts); videos uninspected/unpublished. Leases closed; no SCALE/MASSIVE/Windows acceptance or landing approval at that checkpoint.

Earlier unprofiled, unchanged-workload SMOKEs all failed timing despite the same 67/19 reclamations, protected 30/60/300 conservation/integrity/restoration/reply:

Source Cleanup s Total s Maximum gap ms
c3123cb8259c baseline 51.446139 73.084 536.558243
42994d79a445 sweep Worker 30.823833 52.927 536.364417
6e2383b8569a import boundary 22.436343 47.934 801.714175

Last source: no-op repeat, nine pre-ready violations; higher startup cause unestablished. 42994d79a445 SCALE completed cap/high-water/128 messages, archive lookup beyond first 50 rows, restoration/restart/immediate crash recovery, but cleanup >30 minutes; no completed sweep/final conservation. Valid generations 1–3: 11 post-ready gaps / 1,205.864853 ms; generation 4 invalid after unbracketed deadline SIGKILL; strict validation/cleanupComplete=false retained. Archives/journals/stable inventories/empty groups independently verified; all historical Testboxes closed. Inspected before-restoration and restored-history/new-reply images belong to 42994d79a445; video uninspected/unpublished.

Historical build/CI failures, not waived gates

  • 9b4f7e8c614: missing Worker-ID regression failed then passed. First build rejected evidence in compiler namespace; moving evidence only allowed normal build 7m31.4s. Archive bootstrap 128 chunks excluded reclamation/lifecycle/entry-store/orchestration but retained owner-backed Zod; P0 review was not performance approval.
  • September 7: CI-only type cycle escaped runtime check; unchanged types moved, Madge/runtime checks passed. Strict smoke covered 152 SDK declarations, omitted UI/metadata tail; per-file JS matched sans comments/maps, no whole-bundle claim. Telegram max-lines fixed by #141148. CI 34113706028: one same-head retry cleared planner; changed archive-Worker Windows case again failed 120 s. Diagnostic target 119e789d62e2, Node 22.23.2/one worker/two-case concurrency; Azure allocation failed/released, no diagnostic tests ran. Not dismissed as unrelated or given more time.
  • Pre-f8d32e: thinking test 1,006/1,000 lines fixed by canonical #145632; two obsolete workerData.plan.databaseOptions fixtures failed then passed. Speech timeout absent in three bounded local runs and later CI: no speculative patch/time increase. Upstream Windows consolidation kept 120 s. Native review NEEDS WORK; resources later completed, stress failed; no prepare-run/merge-run or gate bypass.
  • 997baafd CI: HOME removed before lease drainage. Async ownership repair: Zalo 10 failed/466 passed + 28 reset errors→476 passed/55 files, Feishu 6 failed/7 passed→13 passed, 17-case Codex cleanup passed. Successor CI: upstream TLS array-after-variadic refactor: consolidate plugin reload ownership and startup overlays #146275 repaired by fix(gateway): register TLS renewal with sidecar owner #146412. Later narrow repairs covered local shadowing, tsdown 0.23.0 build() shape, Windows premature archive removal and Gateway fixture ENOENT before coordinator drainage. Startup MessagePort, archive-boundary, artifact-preparation, startup-integrity, competing-parent validation, retirement/quarantine/commit-close/queue regressions failed before repair; dependency/fixture-type/line-cap failures received no exemptions. Assertions, timeouts, public error identity and complete shutdown graph remained intact.

Immutable identities and seals

All following values are SHA-256; “source/build” identifies the inventories, not a new runtime pass. Missing hashes for other runs were not supplied in the original record and are not invented here.

Source / artifact SHA-256
ccdd7bb package 06fd7bc50582ca175cbff2fab17cb28f3be6a11d0a1323c5e1963ccfa66fdb70
ccdd7bb source inventory 23de350d0d0203c686d0ed26c272fdb2677d9d3ff5dc32781d2fc01e0c3a10e4
ccdd7bb build inventory f80a4ea3ac3c2a29b076712913817d16911490673da2e076bb9e1945fe767814
ccdd7bb SMOKE archive 00d4e3720ceef97591f41c7e3c630725e824738cd8841304868269d6e68d6bcb
ccdd7bb failed SCALE archive 6432a30fe5643c239043990fda9f76b8e14d791398564c673de57f53f06a0a13
b9380a4 CPU diagnostic archive d2110602fd93a1fd89f79e3b97d0deae747e6a70247de028907b26f8d5471709
b9380a4 package 6a3a6248d9ea92fd210755dece5e894f5eb3d68278b0206fb6510c85fb57fd8d
b9380a4 source inventory 071a26665d798d799ee207d804028404bcb04fc17247b25ef5872a8e69b0b73a
b9380a4 build inventory 7739846d4f79fc74f99b3833f6ba728a17cefe1ab4f62a441ccb3fd000a54f17
b9380a4 SMOKE archive 5cae96bad2e949337e2c45fd8fad7bbb21f76fe101a1119e78db721cfa2dc87a
7ccf361b package 47ac5f5376a493927cdde5c94e973aca558688d621ed81e4349c5a80635c7898
7ccf361 published-update archive d7096c29ef4047c036f66852104914dab4a460142683379746a91a181f9c94e4
997baafd raw-fixture SMOKE archive 6b980efc23e448035f6f6481943718f2fa7bc7708735f4f44a49b1d2cb92b316
f8d32e reconstructed-rig archive 2e4d5967082c7f58f1def35de93b684ce52e1f2ed66cadcad78fc586aaedf6b0
f8d32e reconstructed-rig manifest a8a6e9468c4aaa7b7a93d90691d719585c407a8c866ce0f0900153109bae24d8
f8d32e failed SMOKE private archive 043d2897981f1f48e23c0f9f6824789eec242775083d37b7d848a1d7e0798ff9
f8d32e V35 resource archive 7a97be0928c04a682aac1b184e678afd1ec8fd81d5acea18088b3541850d6333
V35 probe source 5c2c427fd4e4e35f0ab84379c3d0182bba6dffaeae69c983d6bfce72b0d192e2
V35 transport command e976efab79fd50cd9d4c058a1340d722490a862261ec967bbd30c24f82620036

@clawsweeper

clawsweeper Bot commented Sep 7, 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 size: L maintainer Maintainer-authored PR labels Sep 7, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 7, 2026
@clawsweeper

clawsweeper Bot commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 13, 2026, 7:45 AM ET / 11:45 UTC (Revision 29).

ClawSweeper review

What this changes

Session cleanup reuses bounded background workers, avoids redundant metadata processing, and moves startup integrity scans off the Gateway thread while preserving archive and deletion ordering.

Merge readiness

⛔ Blocked before merge - 5 items remain

Keep open: this remains useful, maintainer-backed work that current main does not replace. The updated MASSIVE evidence resolves the previous performance blocker, and source review found no blocking correctness defect.

Priority: P2
Reviewed head: d49a43e01bf8db330560b7a2f1258bcf733b68c5

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Strong runtime evidence and coherent lifecycle ownership support a good patch rating; published-updater acceptance remains the merge blocker.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The captured body’s current-build Linux Gateway SMOKE, SCALE, and MASSIVE runs exercise the changed cleanup workers with concurrent reads, archive conservation, and observed native shutdown; MASSIVE now passes. This preserves the runtime proof classification while the separately required published-updater handoff remains pending.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured body’s current-build Linux Gateway SMOKE, SCALE, and MASSIVE runs exercise the changed cleanup workers with concurrent reads, archive conservation, and observed native shutdown; MASSIVE now passes. This preserves the runtime proof classification while the separately required published-updater handoff remains pending.
Evidence reviewed 9 items Accepted lifecycle design: The September 12 design decision explicitly accepts one retained reclamation worker, per-operation authority and settlement, 60-second idle retirement, and joined native shutdown; it also requires published-driver update compatibility. #140897 (comment).
Current main still uses per-operation workers: Fetched main still calls the one-shot archive-worker operation for reclamation and publishes after native exit. The retained worker architecture remains a distinct contribution beyond the merged admission and offline-cleanup repairs.
Latest-release comparison: The v2026.9.4 source also uses per-operation worker reclamation. The local release blob could not be retrieved through Git’s promisor remote, so the source was inspected through GitHub’s contents API.
Findings None None.
Security None None.

How this fits together

OpenClaw’s session storage handles cleanup and deletion requests against per-agent SQLite databases. It protects retained conversations, archives eligible transcripts, commits removals, and publishes results back to Gateway and CLI callers.

flowchart TD
  A[Cleanup or deletion request] --> B[Check current session protections]
  B --> C[Scoped archive worker]
  C --> D[Retained deletion worker]
  D --> E[Recheck authority and commit]
  E --> F[Publish durable results]
  D --> G[Drain on retirement or shutdown]
  C --> G
Loading

Before merge

  • Resolve merge risk (P1) - The actual published 2026.9.4 updater restart handoff remains unverified for this build; retained workers must drain without preventing restart or leaving database leases behind.
  • Resolve merge risk (P1) - The source-runtime measurements show higher immediate RSS, including after drainage; sustained memory cost on smaller hosts remains uncharacterized.
  • Complete next step (P2) - Complete the actual published 2026.9.4 updater restart handoff on the validated build, confirming retained-worker exit, released leases, preserved state, and healthy restart.
  • Review config compatibility - Confirm compatibility and upgrade impact for the changed config or default surface before merge.
  • Add data-model compatibility proof - Confirm migration or upgrade compatibility proof before merge.
Agent review details

Security

None.

PR surface

PR surface statistics unavailable: the file list is incomplete.

Review metrics

Metric Value Why it matters
Production versus test growth Production net +1,475 lines; tests/support net +1,864 lines Production growth implements the accepted worker reuse, admission, and retirement lifecycle rather than new configuration or storage formats.
Current-build MASSIVE acceptance 56m21.895s; maximum lifetime gap 477.838 ms Both the unchanged 60-minute budget and 500 ms responsiveness limit now pass.

Stored data model

Persistent data-model change detected: unknown-truncated-pull-files. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Finish the accepted updater check (recommended)
    Complete the published 2026.9.4 restart handoff against the validated build, showing retained-worker drainage, state preservation, and healthy restart.

Technical review

Best possible solution:

Keep bounded reuse within the existing storage owner, with published-updater compatibility established before landing and the measured memory tradeoff retained in the evidence.

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

Yes for repeated worker startup: current main visibly creates a worker for each reclamation, and the supplied paired workloads exercise that path. Exact latency on fetched main was not reproduced in this read-only review.

Is this the best way to solve the issue?

Yes: the patch extends the existing archive and reclamation owners, preserves per-victim transactions and live guards, and supplies current-build performance evidence; updater acceptance remains outstanding.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: This is a bounded session-cleanup performance improvement with meaningful runtime evidence and no demonstrated emergency regression.
  • merge-risk: 🚨 compatibility: The changed worker lifetime still needs the explicitly required published-updater restart compatibility check.
  • merge-risk: 🚨 availability: Retaining worker heaps changes memory headroom, and the measured increase in immediate RSS has not established sustained small-host behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured body’s current-build Linux Gateway SMOKE, SCALE, and MASSIVE runs exercise the changed cleanup workers with concurrent reads, archive conservation, and observed native shutdown; MASSIVE now passes. This preserves the runtime proof classification while the separately required published-updater handoff remains pending.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured body’s current-build Linux Gateway SMOKE, SCALE, and MASSIVE runs exercise the changed cleanup workers with concurrent reads, archive conservation, and observed native shutdown; MASSIVE now passes. This preserves the runtime proof classification while the separately required published-updater handoff remains pending.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Verify the actual published 2026.9.4 updater restart handoff with a live retained worker using the same validated build.

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 (28 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-13T08:16:36.339Z sha 81c77fe :: blocked before merge. :: none
  • reviewed 2026-09-13T08:34:17.004Z sha 81c77fe :: blocked before merge. :: none
  • reviewed 2026-09-13T08:46:18.875Z sha 81c77fe :: blocked before merge. :: none
  • reviewed 2026-09-13T09:55:50.701Z sha d49a43e :: blocked before merge. :: none
  • reviewed 2026-09-13T10:09:40.172Z sha d49a43e :: blocked before merge. :: none
  • reviewed 2026-09-13T10:21:02.398Z sha d49a43e :: blocked before merge. :: none
  • reviewed 2026-09-13T10:36:23.215Z sha d49a43e :: blocked before merge. :: none
  • reviewed 2026-09-13T10:49:04.966Z sha d49a43e :: blocked before merge. :: none

@steipete
steipete force-pushed the steipete/retention-sweep-followup-20260907 branch from 42994d7 to 9b4f7e8 Compare September 7, 2026 10:14
@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime commands Command implementations size: XL and removed size: L labels Sep 7, 2026
@steipete
steipete marked this pull request as ready for review September 7, 2026 10:18
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. proof: sufficient ClawSweeper judged the real behavior proof convincing. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Sep 7, 2026
steipete added a commit that referenced this pull request Sep 11, 2026
Refresh the disk-pressure cleanup optimization in #140897 against current SQLite ownership. Keep per-victim retained claims, authorization and publication ordering while reusing one Worker per sweep. Bind each request to its own async context and preserve the original authority error during cleanup.

Focused owner, archive and combined regression tests, classified checks, full build and independent P0 review passed. Full stress acceptance remains blocked by missing original harness inputs; this commit does not claim landing readiness.
@steipete
steipete force-pushed the steipete/retention-sweep-followup-20260907 branch from dc3e79e to e1294ec Compare September 11, 2026 23:13
steipete added a commit that referenced this pull request Sep 12, 2026
Refresh the disk-pressure cleanup optimization in #140897 against current SQLite ownership. Keep per-victim retained claims, authorization and publication ordering while reusing one Worker per sweep. Bind each request to its own async context and preserve the original authority error during cleanup.

Focused owner, archive and combined regression tests, classified checks, full build and independent P0 review passed. Full stress acceptance remains blocked by missing original harness inputs; this commit does not claim landing readiness.
@steipete
steipete force-pushed the steipete/retention-sweep-followup-20260907 branch from b4f42e2 to f895cb1 Compare September 12, 2026 03:49
steipete added a commit that referenced this pull request Sep 12, 2026
Integrate the disk-pressure performance follow-up #140897 with cold storage from #145172. Share request admission and authorization while keeping cold mutations one-shot through cleanup and native exit, and retaining one validated reclamation Worker per sweep. Keep restore preparation, synchronous commit checks, publication ordering and final physical accounting intact.

Remove inherited dead UI exports and obsolete styles, exercise configuration through its real menu entrypoint, reuse picker test setup, and consolidate duplicate lifecycle notification construction. Preserve the 720-root and file-size limits without suppressions.

Focused cold/reclamation/Gateway tests, reset and UI coverage, classified checks, full build and independent P0 review passed. Full stress acceptance remains pending the separately reviewed replacement rig.
@openclaw-barnacle openclaw-barnacle Bot added the app: web-ui App: web-ui label Sep 12, 2026
@steipete steipete closed this Sep 12, 2026
@steipete steipete closed this Sep 13, 2026
@steipete steipete reopened this Sep 13, 2026
@steipete
steipete merged commit 7ab5077 into main Sep 13, 2026
440 of 442 checks passed
@steipete
steipete deleted the steipete/retention-sweep-followup-20260907 branch September 13, 2026 12:06
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 13, 2026
* commit '4aff70f27016f9acf62d0acc19c8bd3592993e4c': (1537 commits)
  test: align plugin fixtures with current runtime contracts (#147000)
  refactor(browser): separate session tab tracking from cleanup (#146973)
  fix(tests): make systemd clock fixtures private (#146990)
  fix(linux): retire sleep guards when logind disconnects (#146046)
  refactor(matrix): share draft fallback delivery (#144840)
  fix(sessions): preserve cross-agent replies after reload (#146799)
  test(models): cover quota recovery during catalog discovery (#146708)
  fix(macos): recover browser sign-in when no browser opens (#146787)
  fix(process): prevent one-shot agents exiting while polling (#144268)
  fix(status): label the session inventory as stored (#146979)
  fix: avoid repeated background reads while loading chat (#146953)
  refactor(ui): narrow Skill Workshop proposal context (#146977)
  perf(sessions): keep cleanup responsive and reuse workers (#140897)
  fix(sessions): prevent stranded writers after abort and restart (#146792)
  refactor: reuse deferred owners in Gateway and infra fixtures (#146809)
  fix: prevent queued conversation replies from switching storage (#146984)
  test(ui): preserve nested failure summaries in CI logs (#146864)
  fix(test): respect process memory limits in local scheduling (#146298)
  fix: validate large media data URLs without regexp stack exhaustion (#146972)
  fix(ui): label model usage contributions as messages (#146735)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: feishu Channel integration: feishu cli CLI command changes commands Command implementations docs Improvements or additions to documentation extensions: memory-core Extension: memory-core gateway Gateway runtime maintainer Maintainer-authored PR 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. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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