Repository navigation
fix(sessions): shipped updaters refuse the next release because the transcript worker re-emits the Gateway graph - #200321
Merged
fuller-stack-dev merged 1 commit intoNov 17, 2026
Conversation
…ranscript worker re-emits the Gateway graph The transcript reader constructs SessionManagerCore to plan compaction. The class also carried host-side hydration, whose cold-storage restore reaches the session controller, plugin loader and Gateway methods. The reader's private code-split build re-emitted that graph as about 5,800 chunks and pushed the installed tree past the 47,500-entry budget and the 50,000-entry cap frozen in published updaters. Host hydration moves to SessionManagerHydration, between the core and native persistence, so the reader's graph no longer reaches it. The session codec logs through its subsystem logger directly: in the smaller graph its static import of the root logger defeated the lazy one in process/exec and failed the build. The build-graph guard now runs on source changes in PRs, counts private chunks per worker and names the host hydration modules the reader must not load.
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Member
Author
|
Merged via squash.
|
fuller-stack-dev
deleted the
fix/transcript-worker-private-chunk-budget
branch
November 17, 2026 00:50
RomneyDa
added a commit
that referenced
this pull request
Nov 17, 2026
Integrate main 687dc6c into PR #200313 only. Preserve #200321 host hydration ownership while retaining shared read-only navigation and the host-only JSONL parser. Keep the beta release baseline unchanged. Co-authored-by: RomneyDa <[email protected]>
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Nov 17, 2026
…ranscript worker re-emits the Gateway graph (openclaw#200321) The transcript reader constructs SessionManagerCore to plan compaction. The class also carried host-side hydration, whose cold-storage restore reaches the session controller, plugin loader and Gateway methods. The reader's private code-split build re-emitted that graph as about 5,800 chunks and pushed the installed tree past the 47,500-entry budget and the 50,000-entry cap frozen in published updaters. Host hydration moves to SessionManagerHydration, between the core and native persistence, so the reader's graph no longer reaches it. The session codec logs through its subsystem logger directly: in the smaller graph its static import of the root logger defeated the lazy one in process/exec and failed the build. The build-graph guard now runs on source changes in PRs, counts private chunks per worker and names the host hydration modules the reader must not load.
tideclaw-bot
pushed a commit
that referenced
this pull request
Nov 24, 2026
Derive the build mode and preparation cost from exact selected test files. Declare and exercise the already-packaged transcript reconciliation worker for both lifecycle test paths. Release adaptation: add the build-mode calculation to stable's selected planner without importing main-only worker-env and #204314 timeout changes. Retain the stable runtime-config dir and lint inventory; remove only the retired close-failure fixture suppression, not add the unrelated compacted session-model fixture entry that is absent on stable. Companion audit: #201666, #201181 and #203241 are present-equivalent; the canonical transcript worker manifest/build entry is already on stable. #204314 is not required (independent timeout projection). #200321 is not required for this test-only worker switch. The original audit pin predates #202514; no later same-path, PR-number, or SHA follow-up through ad629bc. (cherry picked from commit ad2f629) Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit c23a5aeddea2f5b92a135dec4ae47ef67393675e)
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: #200114 introduced the regression and its feature is kept. #164494 is an open proposal to run the installed-tree budget on main pushes.
What Problem This Solves
Fixes: already-published updaters would refuse the next release, because a clean build of
maininstalls to 52,229 entries and those updaters reject installed trees over 50,000.The 47,500-entry release budget exists to catch this before a release.
mainhas been over it since #200114, and the scheduled published-driver update cell fails withInstalled candidate tree exceeds the release budget.User Impact
User impact: a clean build of this branch installs to 46,826 entries, 674 under the 47,500 budget, so
openclaw updatefrom a published version can install the next release. Compaction still prepares large histories in the transcript reader, as #200114 added.No config, schema, protocol or dependency changes. The budget, the cap and their counting rules are unchanged.
The headroom is thin. 674 entries is 1.4% of the budget. That is roughly where
mainstood before #200114, not new slack. Earlier measurements that I did not repeat put the parent of #200114 at 46,795 and published[email protected]at 47,481. More headroom needs separate reduction work and is not part of this fix.Update behavior. This changes what the package contains, not how an update runs. The installed updater still walks the candidate tree against its frozen cap, and the candidate now fits. Nothing keys on updater markers and no operator state is read or changed.
Why This Change Was Made
The transcript reader is built on its own, with code splitting and private chunk names, so it shares no chunks with the main bundle. Every module it can reach, statically or through
import(), is emitted again as a private file.#200114 made the reader lazily import
session-compaction-prepared.worker.ts, which constructsSessionManagerCoreto read the active branch. That class also carried host-side hydration. The traced edge:Only the host restores cold storage. A read worker reports a cold transcript to its host and stops. On
mainthe reader's graph is 11,596 source modules by esbuild metafile, against 1,831 without that import, and it builds to 5,792 private chunks.The fix moves the five host hydration methods out of
SessionManagerCoreinto a newSessionManagerHydrationclass between the core andSessionManagerNativePersistence. The method bodies are unchanged, andSessionManagerinherits every one of them through the same chain. The reader still constructs the core, and nothing it reaches imports host hydration now. Its graph is 2,068 modules and it builds to 382 private chunks.The smaller graph exposed one more edge. The session codec's static import of the root logger landed in the same chunk as the lazy
import("../logger.js")insrc/process/exec.ts, and the build rejects an ineffective dynamic import. The codec now callscreateSubsystemLogger("parseJsonlEntries")directly. The root logger already routed that prefixed line to the same subsystem logger, so the log line is unchanged.Options considered
import()instead.session-transcript-hydration.tsimports that module statically and is itself reached from the core, so this cut needs a restore hook registered by the host. Moving hydration off the core needs no new hook.Why PR CI missed it, and what guards it now
The installed-tree budget runs in Package Acceptance, which is dispatched manually or called from release checks, and in the published-driver update cell on scheduled
mainvalidation. Neither runs on pull requests.shouldRunPublishedDriverUpdatereturns false forpull_request, and the cell showsskippingon #200114. The scheduled cell did catch it afterwards. CI run 43959978735 failed on Linux withInstalled candidate tree exceeds the release budget (52228 entries, 619284167 bytes).A cheaper guard already existed and already fails on
main.test/scripts/runtime-process-build-graph.test.tsasserts that no standalone worker contains the Gateway server graph. It bundles the workers at test time, so the PR planner's import graph never connects it tosrc/**, and the planner treats files undertest/scripts/as release-only tooling unless a change selects them. With #200114's 100 changed files and the options PR CI passes, the planner onmainselects 1,826 test files and not this one.This PR registers that test with the existing source policy watch, next to
eager-import-closure.test.ts, so source changes select it on PRs. It adds no workflow. With the watch entry, the same input selects it. The test also gains two checks:session-manager-hydration.ts,session-transcript-hydration.tsandsession-cold-storage.ts.I did not add an installed-entry count to PRs. It needs a full build, a pack and an
npm installper PR, which is a slow job. #164494 proposes it for main pushes.Evidence
macOS arm64, Node 26.12.1, npm 11.20.0. One clean build each, with no
dist,dist-runtimeor.artifactsbeforehand.dist/config/sessions/transcript-*main9a6a00eThe base moved twice while I worked, from 9a6a00e to 910f6b9 and then to 2cc6988. Neither range touches a file in this diff, the build configuration, the lockfile or the budget script. I did not repeat the full red install on the later bases. With this PR's
srcchange reversed on 910f6b9, the reader alone builds to 5,796 chunks, and with the change it builds to 383, counting its entry file.The lazy module still loads from built output.
src/agents/sessions/session-manager-hydration-stream.test.tsdrivesreadPreparedSessionCompactionInWorkerthrough a real reader thread for plan, render, cancellation and oversized-history cases. The test runner compiles that reader with the same private-chunk options asdist. All 12 cases in that file pass../transcript-session-compaction-prepared.worker-Wt6Onj7f.mjs, foundreadPreparedSessionCompactionas its export and ran it to its first cancellation check. Loading that chunk evaluates its whole static closure from installed files,SessionManagerCoreincluded. The smoke does not read a database.Guard, red then green. With this PR's
srcand planner changes reversed on 910f6b9, three cases in the two touched test files fail. The reader builds to 5,796 chunks against the 1,000 limit, the reader's graph contains 623 forbidden Gateway, flows and wizard modules, and the planner does not select the guard for a source change. With the change, all 64 cases pass.ci-changed-node-test-plan.source-owners.test.tsnow expects the guard among the tests any source change selects, and that expectation fails without the watch entry.Checks. The diff is identical across the rebases below, and each line names the base it ran on.
oxfmt --checkon the 11 changed files,git diff --checkpnpm tsgo:allnode scripts/run-oxlint.mjs <changed files>OPENCLAW_CHECK_CHANGED_SKIP_DEADCODE=1 node scripts/check-changed.mjsPR CI on bbd2cac finished with 83 checks passing and none failing,
build-artifactsincluded. The guard file ran there on Linux inchecks-node-compact-small-8, 64 tests in 21.5s. This PR edits the guard file, so that run does not by itself show the new watch selecting it. The planner numbers above do.The dead-export scan is skipped in
check-changed. Run alone,pnpm deadcode:exportsexits 1 with 126 entries, and none is in a file this PR changes.Test files audited in full
test/scripts/runtime-process-build-graph.test.ts. All three existing behaviors stay: the shared-entry filter, the lazy optional handlers and the Gateway-graph exclusion. The inlined tsdown build became one helper that the new chunk cases share, with the same build options, disposal and temp-dir owner. Nothing was removed.test/scripts/ci-changed-node-test-plan.source-owners.test.ts. One expectation gained an entry. I found no dead, vacuous or duplicate case to prune.Not proven
scripts/perf/session-reload-measure.tsswapssession-manager-core.tsandsession-manager-codec.tsfor A/B runs. I left it alone. The async reload entry point it calls now lives insession-manager-hydration.ts.Review. A fresh agent reviewed the diff read-only and found no blockers. This head addresses its findings on the chunk guard, the comments and a stale doc reference. The autoreview helper cannot run on this machine, so there is no autoreview result.