openclaw/docs/reference
Peter Steinberger fcc173fc5b
perf(gateway): show the first chat sooner after a Gateway start (#162936)
* perf(gateway): prepare history workers before the first chat read

The history worker reached the full session lookup/runtime graph through
source candidate selection. Branch snapshots also imported their host list
coordinator and writer-side reexports. Extract the shared candidate owner
and isolate branch snapshots/cache from host coordination without changing
selection, admission, watermark reuse, restoration, or cleanup.

Prioritize complete history preparation, including the response encoder,
and allow only this worker operation during foreground browser loading.
Main-thread handler/optional preparation remains idle-only. Preserve the
post-ready barrier, root admission, shutdown joins, and worker custody;
ready never awaits this work. No schema, protocol, public SDK, configuration,
dependency, persistence, or update behavior changes.

Reproduction: three isolated seeded starts on Node 26, zero added RTT.
Cold chat.startup server ms: 2020,586,2041; visible ms: 4440,2246,3739.
Warm server ms: 12,12,12; visible ms: 544,12098,16714. The last two warm
outliers occurred before WebSocket connection, not in chat.startup.

Four interleaved rounds against a preserved build of main 83a974025c,
same worktree/runtime paths and cloned synthetic fixtures (1500 turns plus
30 x 60 turns), fresh browser per load, immediate navigation after ready:
- Main cold server/visible ms: 647/2356,751/2557,556/2015,1034/2893.
- Candidate cold server/visible ms: 59/2059,51/1644,55/1760,89/1877.
- Main warm server/visible ms: 11/456,14/472,13/546,12/484.
- Candidate warm server/visible ms: 11/503,13/493,13/596,13/505.
Cold medians: server 699 -> 57 ms (-91.8%); visible 2456.5 -> 1818.5 ms
(-26.0%). Warm medians: server 12.5 -> 13 ms; visible 478 -> 504 ms.
Branch RPC cold medians: 657.5 -> 572.5 ms.

CPU diagnostics aligned to the first chat.startup server interval:
baseline 1171.4 ms under history-worker module loaders in a 1278 ms request;
candidate 0 ms in a 71 ms request. Candidate loading instead sampled
2635.7 ms after ready, before the request. Samples are approximate wall-time
attribution, not exclusive CPU accounting. Branch worker bootstrap still
costs time: the final loaded-host profile sampled 1079 ms loading in a
1930 ms branch RPC. No claim that branch cold loading is eliminated.

Full process-to-ready medians were 14352 -> 16372 ms on the shared host;
listening-to-ready medians were 674.5 -> 646.5 ms. Warmup remains after
ready; total restart-time improvement is not established.

Validation: 224 tests across 12 focused files pass. Import-boundary and
foreground-prewarm regressions fail before their fixes. Changed-file test
wrapper wall costs: session-history-read.imports 10.86s (2 tests),
server-startup-handler-prewarm 5.94s (12 tests), session-utils 51.46s
(104 existing tests; only its type import moved). The architecture guard
checks static worker boundaries; no timed performance assertions were added.
Core, core-test, root-test typechecks pass; both import-cycle checks report
zero; all five typed core lint stripes pass, with the affected Gateway
stripe refreshed after the final change. Full runtime/postbuild/UI builds,
UI performance checks, oxfmt, diff checks, and Codex P2 review pass.

* fix(gateway): drop unused discovery-cache type re-export

Callers import GatewaySessionStoreDiscoveryCache from its new owner,
session-utils-store-candidates.ts; the session-utils barrel re-export had
no consumers and failed the production deadcode check.
2026-10-01 13:48:04 -07:00
..
database-schemas perf(gateway): show the first chat sooner after a Gateway start (#162936) 2026-10-01 13:48:04 -07:00
full-release-validation feat(release): let a release lead record an exact-job flake instead of blocking publication (#161515) 2026-09-30 04:31:07 +00:00
session-management-compaction feat(sessions): snooze sessions from the sidebar menu (#161960) 2026-09-30 14:32:33 -07:00
templates
test fix(ci): cap Testbox concurrency and idle spend (#162678) 2026-10-02 02:16:05 +07:00
AGENTS.default.md
api-usage-costs.md
credits.md
database-schemas.md perf(state): retire periodic runtime integrity scans (#162015) 2026-09-30 19:44:01 +00:00
device-models.md
full-release-validation.md
memory-config.md fix(bedrock): memory indexing fails under instance metadata throttling (#161164) 2026-09-29 20:39:49 +08:00
openclaw-ai.md
prompt-caching.md fix(active-memory): recalls on claude-cli never reuse the prompt cache (#160768) 2026-09-29 04:52:53 +05:30
pull-request-review-flow.md fix(scripts): prevent host tooling drift from blocking PR workflows (#152078) 2026-09-18 14:34:18 -07:00
release-performance-sweep.md
RELEASING.md fix(release): require signed publication tags (#162323) 2026-09-30 21:27:24 -07:00
rich-output-protocol.md fix: resend inbound attachments referenced from chat history (#158720) 2026-09-26 21:02:02 +05:30
rpc.md
secret-placeholder-conventions.md
secretref-credential-surface.md
secretref-user-supplied-credentials-matrix.json
session-management-compaction.md
test.md
token-use.md fix(models): apply downloaded catalogs without a Gateway restart (#158000) 2026-10-01 13:27:55 +08:00
transcript-hygiene.md improve: sessions_send delivers a peer's reply once instead of running automatic agent ping-pong (#162227) 2026-10-01 17:28:00 +00:00