Repository navigation
chore: trace first-run Gateway work and verify later replies - #195185
Merged
Merged
Conversation
Compile only model info for disposable Apple Foundation Models discovery and load the setup detection owner without the activation barrel. Keep full optimized inference compilation on explicit selection. Extend the isolated first-run workload with opt-in server attribution and a third real reply. Performance acceptance is measured separately; no session or database runtime behavior changes.
Keep the strict unique reply assertion while excluding the streaming working placeholder from readiness. Firefox can expose that placeholder beside the reply during the third turn.
Isolate the Apple info-only compilation change. The wider setup candidate improved detection medians but failed later-turn latency and CPU guardrails, so retain the existing detector barrel and its tests.
The Apple-only candidate improved setup detection but failed first-reply and later CPU guardrails in the paired Firefox run. Restore the native helper and retain only the reusable first-run benchmark improvements.
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Contributor
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
steipete
enabled auto-merge (squash)
November 8, 2026 11:13
Contributor
Author
|
Merged via squash auto-merge.
|
vincentkoc
added a commit
that referenced
this pull request
Nov 8, 2026
…tooling-lint-selection-20261108 * commit 'b0e90e6a4b359fff7756698067fdce4758b1907b': (38 commits) fix(android): Talk button demands a realtime provider on a native Talk setup (#191194) chore: trace first-run Gateway work and verify later replies (#195185) fix(knowledge): keep deleted messages out of reply previews (#195126) fix(agents): preserve streamed replies across Gateway restarts (#195164) perf(ci): reuse SDK transport path boundaries (#195180) fix(sandbox): avoid pauses for unchanged command checkpoints (#195120) fix(test): make retention checks portable across runtimes (#195091) fix(knowledge): clarify temporal kind filters (#194995) improve: reduce Gateway allocation while draining SQLite receipts (#195129) fix: reduce streaming CPU after reply and voice directives (#195145) fix: reduce Markdown reparsing during streamed tool-call checks (#195161) fix: restore the main dead-export gate (#195158) improve(ci): pack small UI selections into fewer jobs (#195107) fix(muse): quota and sign-in failures end with no reply (#195148) fix: allow first release push with shipped patch bytes (#195174) fix(ci): narrow single-config tooling selections (#195147) fix(packaging): reject incompatible prepublish plugin cohorts (#195152) fix(ci): prepare verified Bun before parity checks (#195155) fix: Incognito agent turns stall before execution (#195005) fix: credentialed search and speech providers work without picking a provider (#195169) ...
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Nov 9, 2026
…w#195185) * perf(gateway): trim cold setup detection work Compile only model info for disposable Apple Foundation Models discovery and load the setup detection owner without the activation barrel. Keep full optimized inference compilation on explicit selection. Extend the isolated first-run workload with opt-in server attribution and a third real reply. Performance acceptance is measured separately; no session or database runtime behavior changes. * test(perf): wait for completed first-run replies Keep the strict unique reply assertion while excluding the streaming working placeholder from readiness. Firefox can expose that placeholder beside the reply during the third turn. * perf(gateway): keep setup detection import timing unchanged Isolate the Apple info-only compilation change. The wider setup candidate improved detection medians but failed later-turn latency and CPU guardrails, so retain the existing detector barrel and its tests. * test(perf): retain diagnostics after rejecting runtime candidates The Apple-only candidate improved setup detection but failed first-reply and later CPU guardrails in the paired Firefox run. Restore the native helper and retain only the reusable first-run benchmark improvements.
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: #194866, #194914, #194958
What Problem This Solves
The first-run benchmark could not attribute Gateway subprocess costs and stopped after the second reply, leaving later-turn regressions outside its workload.
User Impact
There is no production behavior change. The benchmark now measures a third real reply, can collect opt-in Gateway profiles and executable-only subprocess timing, and keeps the synthetic workspace's Git discovery inside its fixture.
Why This Change Was Made
The first-run investigation traced two different costs: setup detection's native/compiler probes, and cold first-reply admission, session hydration/writing, skills and memory preparation. Independent setup probes and diff-baseline preparation already overlap. Three optimization variants failed the paired-flow guardrails, so every Gateway, session, database and Apple runtime change was removed. This PR keeps the reusable measurement improvements; it makes no latency-win claim.
The reply selector waits for a new completed assistant group, retaining the unique exact-answer assertion. Firefox can briefly expose a working placeholder beside the answer in a streaming group. Profiling is opt-in; subprocess records contain only the executable basename and timings, with no arguments or environment.
Evidence
pnpm tsgo:scriptspassed on the unchanged final script contentpnpm deadcode:knippassed on the final sourceThe workload used fresh isolated state, a real Gateway and browser, and a loopback synthetic model with sub-millisecond inference. No operator credentials, live services or visible browser windows were used. Baseline:
25eeb08580614c4dd14bd7b0549e6e999d11d44d. The known teardown failure remains explicit: the Gateway acknowledges shutdown, but some process handles keep it alive until the harness terminates its owned process tree. These runs therefore exited nonzero for shutdown despite completing the journey assertions; this PR does not hide or fix that failure.Rejected optimization evidence and remaining owners
Predeclared acceptance required at least a 5% target gain, 20 rotated base/control/head triplets with an A/A control in Chromium, Firefox and WebKit, and no affected-flow regression beyond the timing/CPU guardrails. No candidate met it. Failed candidates were stopped rather than spending the remaining engine runs or extending samples for a pass.
The unchanged controls also moved, so these are failed acceptance results, not established causal explanations. In the last candidate, Chromium's third-reply p95 rose 25.52% while its A/A control rose 26.88%; aggregate CPU and work counts improved. A predeclared ten-pair extension for that uncertainty became unnecessary when the completed Firefox result rejected the candidate independently. No unfavorable samples were removed and no performance change remains in the PR.
A single profiled baseline journey attributed first-reply preparation to pre-dispatch admission (~1,983 ms), session initialization (~720 ms; hydration ~542 ms and writer ~177 ms), skills (~157 ms), and system-prompt preparation (~384 ms, including memory acquisition ~364 ms). Diff-baseline preparation (~299 ms) already overlaps; these inclusive/nested diagnostic spans must not be summed. Synthetic inference was under 1 ms. Session admission/hydration belongs to the session/database owners; memory acquisition belongs to Memory Core. No existing safe code-only warmup or empty-memory gate was found that preserves the first reply's context, and the real first-run UI does not create the session before its first send.
Reproduce the extended workload with
scripts/bench-control-ui-rpc-payloads.ts --first-run --engines chromium,firefox,webkit --samples 20 --profile local --idle-ms 0 --no-rpc-observer; comparison mode uses--compare-entryand--compare-bundle-dirfor the base runtime/UI. Add--server-profileonly to a separate diagnostic journey. Full instructions are inscripts/bench-control-ui-rpc-payloads.md.LOC in the four changed files: 2,419 → 2,509 (+90). Production runtime LOC: unchanged. No visual behavior changes or screenshots are needed.