Repository navigation
fix(catalog): keep capture contexts fresh in the prepared model catalog worker (backport #158323 to 2026.9.7) - #158808
Merged
Conversation
Backport the catalog native ESM retention repair and worker memory attribution from #158323 to release/2026.9.7. (cherry picked from commit 5e4b43c) Conflicts: keep the release worker's exact-generation fingerprint and release custody while retaining one current generation per loader workspace. Port memory sampling, native fallback, coverage, and bundle import through the release registry. Exclude main-only catalog/lifecycle refactors and preserve the release atomic writer. No prerequisite commits are required.
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review in progressClawSweeper is reviewing this revision. This supersedes any previous blocked status. |
steipete
marked this pull request as ready for review
September 26, 2026 10:01
roboclaw-bot
added a commit
that referenced
this pull request
Sep 27, 2026
Merge the already-landed release/2026.9.7 history at 7bd08b5 into the reviewed prepared branch without re-cherry-picking external sources. Preserve canonical native admission, companion namespaces, exact-generation fingerprints, worker publication and atomic index ownership alongside the parent's legacy census, cleanup and live lease repairs. Resolve four conflicts and retain both test inventories. A damaged native instance is not tokenless legacy scratch: keep its published payload when the coordinator disappears. Add the existing Doctor journal-history helper to the extracted-wrapper manifest; no database source changes. Canonical provenance remains in the merged history: - #158770 / source #157565 (PollyBot13, landed by Peter Steinberger) - #158808 / source #158323 (Peter Steinberger) - #158910 / sources #158414 and #158769 (Peter Steinberger) Verified 1,019 exact-parent, 82 exact-canonical and nine combined postimages. Two composition regressions reproduced and corrected. 157 focused owner cases and two wrapper closure checks pass, as do production/test types, lint, formatting and all frozen eb377ac ratchets. Full build passed in 262 seconds. Independent P0-P2 review completed all three passes clean. Compilation is not installed-driver qualification. Normal built integration preflight still refused runtime-artifact-publication/systemd-competing-managers. The separate coupled database backport and its bound fixture hunk remain unapplied. Version and dependencies are unchanged; public size-policy hold remains active. Implementation and verification: https://team.openclaw.ai/chat/roboclaw/subagent/69c28824-7ae8-4692-9037-6998b58bc7f4 Discussion, review and integration: https://team.openclaw.ai/chat/roboclaw/dashboard/db4d78ac-b19b-4f64-adfb-0ca7973a62e4 Co-authored-by: RomneyDa <[email protected]> Co-authored-by: vyctorbrzezowski <[email protected]> Co-authored-by: steipete <[email protected]> Co-authored-by: jalehman <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #158323, #157842
What Problem This Solves
Backports the fix for native ESM memory retained when catalog requests alternate between unchanged loader workspaces to
release/2026.9.7, together with accurate worker memory attribution.User Impact
Catalog workers keep each workspace's current prepared generation, so alternating unchanged workspaces reuse their captured native dependencies. Worker diagnostics include heap, external memory, ArrayBuffers, sample age, and explicit incomplete coverage; exported bundles preserve these measurements.
The release branch keeps its existing exact-generation validation and current-request credential handling. A changed generation can still replace that workspace's context, and native module graphs from actual revisions remain until worker retirement. There are no configuration, CLI, dependency, schema, stored-data, update-driver, or rollback changes. ArrayBuffers are included in external memory, and worker heap limits do not cap external/native memory.
Why This Change Was Made
Cherry-pick provenance:
5e4b43cf86c76b188631ed420032dc221eadd794(main merge of #158323). No prerequisite commits were needed.The catalog worker's single current slot evicted workspace A when B ran. Returning to A captured another native ESM graph, which Node retains even after capture-file cleanup. The existing worker now owns a map of current generations by loader workspace. Replacement still acquires the new generation before releasing that workspace's predecessor; failed candidates retain their existing cleanup path.
Conflict resolution preserves the release branch's own owners and contracts:
Thanks @highfly-hi, @zl0nline, and @oleagui for the original retention and attribution evidence.
Evidence
All commands used Linux x64 / Node 24.19.0 Blacksmith Testboxes and isolated synthetic state. No operator Gateway or
~/.openclawwas used.The release-baseline negative control fails at
20native payloads versus the expected2; baseline bundle import also fails because it drops the worker fields. Restoring the candidate passes all four regression files three times: 65 tests per pass. The catalog regression takes 3.230 / 2.717 / 2.250 s of test time, with 6.72 / 6.08 / 5.37 s Vitest wall on one worker. Baseline catalog test time is 3.618 s (21.17 s Vitest wall).On the same rig, request 5→20 worker heap growth falls from 61,492,104 bytes to 1,299,312 bytes on the first repaired pass. Retained payloads plateau at 2, and external/ArrayBuffer bytes remain exactly flat after request 5. Every request verifies the current agent's synthetic credential through the canonical parent catalog API.
The direct/one-barrel consumer batch passed 273 exercised files / 6,955 tests, with 57 existing platform skips and zero failures. All 274 selected paths were supplied in captured search order;
src/gateway/gateway-models.profiles.live.test.tsis an unexecuted live opt-in file. No live credentials or opt-in flags were enabled. The skips are 48 Windows-only MXC cases, seven POSIX process-fallback cases, one Windows git-null-config case, and one Windows PATHEXT case.The negative controls, three regression passes, and consumer batch ran on lease
tbx_01m3egv90p7xfv70pcga0nxajy, run, exit 0. Consumer runner wall: 1,246.84 s, including shared compiler preparation; complete command envelope: 1,499.608 s. No individual test exceeded 30 s and no file exceeded 120 s of test time; the highest file test cost was 71.935 s. Combined with the separate catalog sibling batch, this covers 285 files / 7,024 passing tests, excluding the additional three regression passes from that total.Changed-file regression cost on one worker: worker CPU 446 / 347 / 313 ms test time (11.48 / 11.11 / 10.14 s Vitest wall); diagnostic memory 90 / 102 / 84 ms; bundle 74 / 54 / 42 ms. The two logging files share 2.35 / 1.65 / 1.60 s Vitest wall. PR CI timings are not yet available at authoring handoff.
node scripts/check-changed.mjs --base origin/release/2026.9.7 -- <20 changed paths>: exit 0, including core typing, all 25 test-type shards, lint, and repository guards. Leasetbx_01m3eg1hbppc3ta3vtw7x3nynb, run, command envelope 1,506.73 s. A portal-sync warning followed the successful command result.pnpm build: passed, build phases 306.4 s. Leasetbx_01m3egbrzvfwep5wswss5pgzvj, run, combined command envelope 582.466 s.git diff --checkpass.The initial full-checkout transfer timed out before any tests; the successful proofs use the verified release-base source capsule. Two negative-control orchestration attempts were corrected (runner stops on the first expected-red project; remote argument-length limit). Neither was a candidate product/test failure. Native Testbox cleanup can leave its backing Actions run marked cancelled; the command exit is the proof outcome.
Production +375 / -89; tests/support +460 / -18; docs +26 / -4; wrapper inventory +2 / -0; assertion baseline 11→9. Auto-merge is off. This PR targets the release branch only and does not publish a release.