Repository navigation
test(gateway): prewarm history worker before composed SDK request budgets - #172745
Merged
Merged
Conversation
Contributor
|
ClawSweeper reviews are opt-in for maintainers. If a review is required, finish the work and validation first, then comment |
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Oct 15, 2026
This was referenced Oct 20, 2026
RomneyDa
added a commit
that referenced
this pull request
Oct 20, 2026
…78169) * fix: distinguish workflow approval and exception capabilities (#172661) (cherry picked from commit aade2f8) Co-authored-by: RomneyDa <[email protected]> * fix(release): expose Linux builder admission and retain failed bundles (#170297) * fix(release): expose Linux builder admission and retain failed bundles * fix(release): preserve unconfirmed Linux dispatch status * fix(ci): make Linux build event admission explicit * fix(ci): separate Linux mirror dispatch from release builds * fix(ci): budget cold Linux source package builds (cherry picked from commit 614f559) Co-authored-by: RomneyDa <[email protected]> * fix(ui): let locale refresh workers bootstrap new locale memory (#172689) (cherry picked from commit 17bea1c) Co-authored-by: RomneyDa <[email protected]> * test(gateway): prewarm history worker before composed SDK request budgets (#172745) (cherry picked from commit 2051055) Co-authored-by: RomneyDa <[email protected]> * fix(android): prepare focused proof before running Gradle (#172668) * fix(android): prepare focused proof before running Gradle * test(android): reach proof prerequisites on Linux ARM * test: remove duplicated Android job structure assertion * fix: seed stored inference account for Docker cron cleanup (cherry picked from commit 404b708) Co-authored-by: RomneyDa <[email protected]> * fix: preserve bound Codex history after app-server restart (#172705) (cherry picked from commit 9fe4372) Co-authored-by: RomneyDa <[email protected]> * fix(release): Linux channel promotion fails after a withdrawn Windows companion (#173615) (cherry picked from commit c58afa2) Co-authored-by: RomneyDa <[email protected]> * ci(release): temporarily disable Windows companion publication (#173656) (cherry picked from commit 99ce3ea) Co-authored-by: RomneyDa <[email protected]> * fix(qa): Telegram live lane fails scenarios when the stale-update drain hits a transient Bot API error (#173465) * fix(qa): retry Telegram stale-update drain through transient Bot API failures * fix(qa): cancel Telegram drain waits on proxy stop and cap attempts by budget * test(qa): prove the Telegram drain abandons a stalled attempt at its deadline * test(qa): drop timing-dependent upstream count from Telegram drain deadline test (cherry picked from commit 387ebd6) Co-authored-by: RomneyDa <[email protected]> * fix(release): validate shipped release provenance markers against main (#173781) (cherry picked from commit eee5b40) Co-authored-by: RomneyDa <[email protected]> * fix(sqlite): settle peer closes after shared worker refusal (#173813) A refused opener stops its shared worker, so queued peer closes receive the slot's existing operation failure without running. Join native exit without recording that exact failed-slot error as a second cleanup failure. Distinct close, termination and lease-cleanup failures still propagate. Update and Doctor teardown can finish retiring peer agent stores after another opening is revoked. The rejected opening retains its error, exact lease cleanup remains owned, and uncertified native exit cannot publish a clean-close seal. The real-worker regression fails on main with native retirement failed and passes with all peer leases removed. The original intermittent sessions-tail case passed six pre-fix replays; the forced owner boundary proves this repair. Proof: sessions-tail/creation-owner/cleanup 62 passed; broker/client/reply, close-wedge and retention siblings 54 passed; final integrity owner 27 passed, one existing Linux-only skip. pnpm test src/state/openclaw-agent-execution.integrity.test.ts --maxWorkers=1: 76.57s wall, 26.00s Vitest, new regression 2.66s. Scoped types, lint, formatting, line-cap and independent P2 reviews pass. PR CI supplies broad proof. (cherry picked from commit 6d51bb2) Co-authored-by: RomneyDa <[email protected]> * fix(gateway): restore 2026.10.4 startup memory by keeping cold start from opening every memory index (#174718) * perf(agents): bound catalog worker young-generation heap Keep the catalog worker's existing 512 MiB old-generation allowance while bounding its young generation to 32 MiB. Forward-port of the release/2026.10.4 fix; main moved the catalog pool into prepared-model-catalog-worker.pool.ts, so the limit now lives on that pool's single resource-limit object. (cherry picked from commit a3510e8) * fix(memory): keep cold Gateway start from opening every agent's index #167756 started Memory Core's index service eagerly on every Gateway start, opening each configured agent's memory manager right after readiness. On an idle Gateway that startup catch-up touches every session-transcript read lane, so each lane spawns its own worker isolate (plus a memory-search worker): the 2026.10.5 Gateway startup peak RSS rose from ~1.1 GB to ~1.8 GB. Cold start is demand-driven again, as before #167756: the first search, flush, or turn that needs an agent's index opens it. Once a watched manager has run in the process (a process-wide fact that survives plugin instance replacement and resets with a Gateway restart), every later service start reopens all configured indexes, so plugin reloads, provider-only reloads, rollback recovery, and memory/agent config restarts still resume watching without a search or turn. * perf(sqlite): bound broker and transcript worker young-generation heaps Cap the SQLite broker carriers and session-transcript reader workers at a 32 MiB young generation, matching the catalog worker bound, while keeping the existing 512 MiB old-generation allowance. Worker counts, lanes, admission, and lifecycle custody are unchanged. V8's default nursery grows to ~63 MiB per worker after a startup allocation burst and stays resident on idle workers. On the 2026.10.5 Gateway (fresh state, forced 16 CPUs) the broker's heap total at startup peak fell 125 -> 91 MiB and the transcript reader 81 -> 34-66 MiB; with the Memory Core cold-start fix, max Gateway peak RSS over the runs fell 1152 -> 1117 MB. Tradeoff: more frequent scavenges during large allocation bursts in these workers. (cherry picked from commit 6c050f8) Co-authored-by: RomneyDa <[email protected]> * fix(ui): start a fresh model catalog read after invalidation (#174812) (cherry picked from commit 919e835) Co-authored-by: RomneyDa <[email protected]> --------- Co-authored-by: RomneyDa <[email protected]> Co-authored-by: Peter Steinberger <[email protected]>
RomneyDa
added a commit
that referenced
this pull request
Oct 20, 2026
…8170) * fix: ClawHub release verification fails while publication is pending (#168153) * fix(release): verify ClawHub only after public finalization * fix: align ClawHub recovery with authoritative publication state (cherry picked from commit 7985ac2) Co-authored-by: RomneyDa <[email protected]> * fix: Linux feed publication tolerates stale public downloads (#168179) (cherry picked from commit 18f2006) Co-authored-by: RomneyDa <[email protected]> * feat(pr): scope worktree cleanup to one PR (#168152) (cherry picked from commit 51c0f56) Co-authored-by: RomneyDa <[email protected]> * feat(release): reconcile exact owned validation cancellation trees (#168267) * feat(release): reconcile exact owned FRV cancellation trees * fix(release): parse cancellation provenance with fixed patterns * fix(release): normalize rerun copies before cancellation discovery (cherry picked from commit 02a2bd2) Co-authored-by: RomneyDa <[email protected]> * fix(release): recover failed receipts without rerunning workloads (#168266) * fix: recover failed release receipts without rerunning workloads * test(release): materialize publication harness preload closure (cherry picked from commit 4485101) Co-authored-by: RomneyDa <[email protected]> * fix(qa): restore Telegram progress E2E delivery (#168675) (cherry picked from commit 1fbfd4a) Co-authored-by: RomneyDa <[email protected]> * docs(release): generate release notes once after validation-recovery backports (#169495) (cherry picked from commit 696fb2f) Co-authored-by: RomneyDa <[email protected]> * fix(release): explain why release:candidate --workflow-sha must be trusted main (#169496) (cherry picked from commit 513d0e7) Co-authored-by: RomneyDa <[email protected]> * fix(release): full release validation helper fails when main advances before admission dispatch (#169500) (cherry picked from commit 992410c) Co-authored-by: RomneyDa <[email protected]> * fix(release): derive attested publish tooling in npm postpublish verification (#169497) (cherry picked from commit 1f8307f) Co-authored-by: RomneyDa <[email protected]> * fix(release): report candidate supersession and resume watchers (#168271) * fix(release): report candidate supersession and resume watchers * fix(release): keep invalid candidate metadata advisory to watchers (cherry picked from commit cdb57ac) Co-authored-by: RomneyDa <[email protected]> * fix(pr): stop waiting for advisory ClawSweeper reviews (#169739) (cherry picked from commit c2d1513) Co-authored-by: RomneyDa <[email protected]> * ci: let PR checks finish and classify inherited failures (#169647) * ci: finish PR jobs and classify failures against main * ci: distinguish signature and job-name failure attribution * test(ci): avoid object spread in failure fixtures * ci: classify differing validation scopes as unknown (cherry picked from commit 7c4ff5a) Co-authored-by: RomneyDa <[email protected]> * fix(pr): scripts/pr keeps a lock after a failed command that fully drained (#169595) * fix(pr): release drained failed-operation locks instead of requiring manual recovery * test(pr): drop unused lock owner initializer * docs(pr): drop obsolete blanket failure-retention claim (cherry picked from commit a939a9d) Co-authored-by: RomneyDa <[email protected]> * fix(update): success headline hides post-swap steps that did not run (#170490) (cherry picked from commit f26cdca) Co-authored-by: RomneyDa <[email protected]> * fix(release): require current website downloads at closeout (#170704) * fix(release): require current website downloads at closeout * fix(release): verify request-time downloads before closeout receipts * style(release): use braces for dispatch validation (cherry picked from commit 0c51cc6) Co-authored-by: RomneyDa <[email protected]> * fix(ci): prevent avoidable FRV retries and cold setup failures (#170964) * fix(ci): preserve FRV work through transient GitHub reads * fix(ci): retain cache reads for frozen workflow targets * fix(ci): count contributing packed release timing samples * fix(ci): avoid stalled iOS simulator diagnostics * test(ci): correct FRV regression assertions and output capture (cherry picked from commit 5cd688d) Co-authored-by: RomneyDa <[email protected]> * fix(update): stabilize stalled recovery cleanup validation (#171507) * test(update): await recovery descendant before fixture expiry Expire the generated helper recovery timeout callback after the isolated command has persisted a live descendant PID and emitted readiness. Keep process-group termination and close joins native, retain the durable failed sentinel and dead-descendant assertions, and bound missing readiness with a fixture watchdog. Refs #170803 (stalled-recovery fixture race only). * test(update): load recovery clock from fixture module Replace the added hand-written preload source template with a test-owned ESM fixture and per-case JSON configuration. Preserve exact helper and recovery command scoping, native timeout callback and watchdog cleanup, persisted descendant readiness and existing deadline, close-order, sentinel and process-death assertions. Production behavior and deadlines are unchanged. Refs #170803 (stalled-recovery fixture race only). * test(update): join state workers before handoff cleanup Await the maintained state-database test cleanup owner before removing managed-handoff fixture directories. Synchronous native-handle close only starts worker retirement and can race the final WAL cleanup, observed as ENOTEMPTY in the retained-notification triage case. Reuse closeStateDatabaseForTest without retries, timing seams, triage behavior changes or production changes. Refs #170803 (managed-handoff test fixtures only). (cherry picked from commit 4a25358) Co-authored-by: RomneyDa <[email protected]> * test(agents): retire session MCP managers left by earlier test files (#172515) (cherry picked from commit d4be691) Co-authored-by: RomneyDa <[email protected]> * fix(release): show publication release and Windows source identities (#170274) (cherry picked from commit 35fffec) Co-authored-by: RomneyDa <[email protected]> * fix: distinguish workflow approval and exception capabilities (#172661) (cherry picked from commit aade2f8) Co-authored-by: RomneyDa <[email protected]> * fix(release): expose Linux builder admission and retain failed bundles (#170297) * fix(release): expose Linux builder admission and retain failed bundles * fix(release): preserve unconfirmed Linux dispatch status * fix(ci): make Linux build event admission explicit * fix(ci): separate Linux mirror dispatch from release builds * fix(ci): budget cold Linux source package builds (cherry picked from commit 614f559) Co-authored-by: RomneyDa <[email protected]> * fix(ui): let locale refresh workers bootstrap new locale memory (#172689) (cherry picked from commit 17bea1c) Co-authored-by: RomneyDa <[email protected]> * test(gateway): prewarm history worker before composed SDK request budgets (#172745) (cherry picked from commit 2051055) Co-authored-by: RomneyDa <[email protected]> * fix(release): packed package check refuses a root dist above 10,000 JavaScript files (#172954) (cherry picked from commit 244cd79) Co-authored-by: RomneyDa <[email protected]> * test(agents): Bun agents-support shard fails after the question authority test leaks sharing reads (#172974) (cherry picked from commit 54f0b41) Co-authored-by: RomneyDa <[email protected]> * test(plugins): IRC direct import smoke times out on loaded runners during its cold compile (#173105) * test(plugins): IRC direct import smoke times out on loaded runners during its cold compile * test(googlechat): keep the direct smoke test deadline above its child budget (cherry picked from commit 8bc4915) Co-authored-by: RomneyDa <[email protected]> * fix(test): interrupted test wrappers miss their signal exit verifying a generation (#173068) * fix(test): interrupted test runs miss their signal exit verifying a generation they will delete * fix(test): keep borrower disposal verification; skip it only for interrupted wrappers * fix(test): return the shim interruption result on every path (cherry picked from commit b66e0fc) Co-authored-by: RomneyDa <[email protected]> * test(openshell): registration lifecycle test fails when registry retirement outlasts its 1s poll (#173205) (cherry picked from commit 7cd0f47) Co-authored-by: RomneyDa <[email protected]> * fix(android): prepare focused proof before running Gradle (#172668) * fix(android): prepare focused proof before running Gradle * test(android): reach proof prerequisites on Linux ARM * test: remove duplicated Android job structure assertion * fix: seed stored inference account for Docker cron cleanup (cherry picked from commit 404b708) Co-authored-by: RomneyDa <[email protected]> * fix: preserve bound Codex history after app-server restart (#172705) (cherry picked from commit 9fe4372) Co-authored-by: RomneyDa <[email protected]> * fix(release): Linux channel promotion fails after a withdrawn Windows companion (#173615) (cherry picked from commit c58afa2) Co-authored-by: RomneyDa <[email protected]> * ci(release): temporarily disable Windows companion publication (#173656) (cherry picked from commit 99ce3ea) Co-authored-by: RomneyDa <[email protected]> * fix(qa): Telegram live lane fails scenarios when the stale-update drain hits a transient Bot API error (#173465) * fix(qa): retry Telegram stale-update drain through transient Bot API failures * fix(qa): cancel Telegram drain waits on proxy stop and cap attempts by budget * test(qa): prove the Telegram drain abandons a stalled attempt at its deadline * test(qa): drop timing-dependent upstream count from Telegram drain deadline test (cherry picked from commit 387ebd6) Co-authored-by: RomneyDa <[email protected]> * test(scripts): give relocated worker facade and image tests the archive budget (#174556) (cherry picked from commit 746a52a) Co-authored-by: RomneyDa <[email protected]> * test(ui): settle lazy preference reader before profile identity waits (#174614) (cherry picked from commit d6ea634) Co-authored-by: RomneyDa <[email protected]> * test(plugins): collect Bun recovery retention from a timer phase (#174924) Bun's JavaScriptCore scans native stacks conservatively. Under load, the immediate dispatcher can keep a stale pointer to the completed recovery fixture graph across every immediate-phase collection, so the retired PluginInstance stayed reachable only through GC-internal roots. A collection from a timer callback releases it. When the expected references are still live after the existing immediate passes, run up to four timer-phase collections; a strong retainer still fails. (cherry picked from commit 8919729) Co-authored-by: RomneyDa <[email protected]> * test(scripts): adapt worker archive timeout backport Keep the release branch test inventory while granting the two relocated archive cases the intended three-minute budget. Co-authored-by: RomneyDa <[email protected]> * fix(codex): adapt unloaded-thread recovery to release params Use the release branch request parameter directly when deciding whether an ordinary bound thread may be resumed. Co-authored-by: RomneyDa <[email protected]> * test(codex): adapt recovery fixture to release helper Use the release branch thread-result helper signature so the recovery regression validates the intended thread identity. Co-authored-by: RomneyDa <[email protected]> --------- Co-authored-by: RomneyDa <[email protected]> Co-authored-by: Peter Steinberger <[email protected]> Co-authored-by: Vincent Koc <[email protected]> Co-authored-by: roboclaw-bot <[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.
Problem
FRV normal CI job https://github.com/openclaw/openclaw/actions/runs/38610437410/job/116012489426 (shard
agentic-control-plane-runtime-state, projectgateway-server-parallel) failed:Root cause
artifacts.listis the first request in the real-Gateway part of this test that reads through the session history worker (readSessionArtifacts->readSessionHistoryPageInWorker->withSessionHistoryWorkerDatabase). The Gateway already has an owner that boots that worker before the first read,prewarmGatewaySessionHistory, but neither of its triggers runs in this fixture:session-history-workerprewarm (server-startup-handler-prewarm.ts) is part of the post-attach sidecars. The minimal test Gateway (minimalTestGateway) skips those sidecars.ws-connection/connect-session.ts) runs only for non-ephemeral operator clients. The App SDKGatewayClientTransportconnects in the defaultbackendmode, which counts as ephemeral.So the first
artifacts.listpaid for a cold worker boot inside the 2 s client request budget. Timings I recorded locally under load (temporary instrumentation in the handler and history runtime):artifacts.list(client)readPageSession resolution, SQLite scope preparation, and acquiring the database owner each took about 2 ms. Nearly all of the time went to the first worker task, meaning the worker boot.
Solution
After the fixture starts the minimal Gateway, it now awaits the same production prewarm owner (
prewarmGatewaySessionHistory(getRuntimeConfig())) that a full Gateway runs after it becomes ready. It also assertsisSessionHistoryWorkerCold()is false, so the test fails loudly if the fixture ever stops warming the worker it reads through. The 2 s request budgets, the assertions, and the production code are unchanged.Evidence
artifacts.listthen took 81 ms (worker read 37 ms). The prewarm targeted the sameopenclaw-agent.sqlitepath that the artifact read used.itbudget before and after the change (the deterministic and startup phases take 40-75 s here), so I raised that budget for these local proof runs only. The committed file keeps 30 s. In CI the whole test took 21.9 s.oxfmt --checkandoxlintare clean on the touched file.pnpm tsgo:core:testpassed.Test cost
One extra worker prewarm per run, about 2 s locally under heavy load. This is the same boot the first
artifacts.listalready paid for, moved ahead of the request budget.pnpm test src/gateway/server.app-sdk-composed-resources.test.ts --maxWorkers=1wall time on this host is 200-236 s, dominated by host load and transforms; the test body took 49-60 s locally.Conditional backport candidate for extended-stable/2026.9.33