Repository navigation
perf(ui): remove request readiness waterfalls - #182347
Conversation
Start independent Settings reads together, let Sessions render while config loads, and keep prior subscription release off the next session's readiness path. Load Cron through its page chunk directly while preserving its lazy route and loading boundary. Extend the cold-load workload with isolated route visits, request timings, and usable-screen markers.
|
🦞👀 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. |
Codex Review SummaryThis 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. |
|
Codex review: needs changes before merge. What this changesThis PR removes unrelated waits from Sessions, Settings, and chat readiness, eliminates an Automations entry chunk, and extends performance instrumentation. Example: Open /sessions while config.get remains pending.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep open: this maintainer-authored PR addresses readiness dependencies still present on main, and source review found no discrete correctness or security defect. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherControl UI route loaders and chat subscription synchronization connect browser navigation to existing configuration and session owners, which issue Gateway requests and publish scoped results. flowchart LR
A[Browser navigation] --> B[Route loaders]
B --> C[Configuration owner]
B --> D[Session owner]
E[Chat synchronization] --> D
C --> F[Gateway RPC]
D --> F
C --> G[Solid views]
D --> G
Technical reviewBest possible solution: Remove the unnecessary dependencies within the existing owners while preserving subscription acknowledgement, scoped publication, retry behavior, and lazy route loading. Do we have a high-confidence way to reproduce the issue? Current-main source directly shows Sessions awaiting configuration, Settings chaining schema loading, and chat readiness awaiting both subscription operations; no target code or tests were executed during this read-only review. Is this the best way to solve the issue? The defect is coupling readiness to unrelated work; the invariant is that each screen waits only for its prerequisites, and the patch makes the focused changes within existing owners. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5dda1e2c1ae9. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource -22, Tests +56, Docs +66, Other +351. Total +451 across 15 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 24, 2026, 3:24 AM ET / 07:24 UTC. |
Preserve critical-path collection alongside thread-CPU timing. Recheck subscription behavior and refresh both performance comparison builds against the merged base.
Keep the existing system-info owner sample for New Session machine labels, while retaining reconnect invalidation. Preserve both critical-path probes and main's thread-CPU/selector instrumentation when merging current main.
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
* perf(ui): remove request readiness waterfalls Start independent Settings reads together, let Sessions render while config loads, and keep prior subscription release off the next session's readiness path. Load Cron through its page chunk directly while preserving its lazy route and loading boundary. Extend the cold-load workload with isolated route visits, request timings, and usable-screen markers. * refactor(ui): drop unused Cron page export * test(ui): model RPC bandwidth in critical-path measurements * test(ui): type the reconnect hello fixture * perf(ui): attribute route CPU in critical-path benchmarks
What Problem This Solves
The Control UI can wait for unrelated configuration or subscription cleanup before showing the requested screen. Automations also downloads a redundant entry chunk before its page.
User Impact
Sessions can show its roster while configuration loads. Settings starts independent config and schema reads together. Replacing a chat subscription no longer waits for the old observer to release, while the new subscription acknowledgement still precedes history. Automations keeps its lazy route with one fewer sequential chunk. New Session reuses the existing system-info owner’s current machine-label sample instead of forcing another read.
Why This Change Was Made
Request policy stays with the existing runtime-config, session, chat and system-info owners. There is no new cache, public option, dependency, protocol change, tag, route or selector. Failed old subscription releases remain the capability’s cleanup responsibility and produce a warning. New Session retains the system-info owner’s ten-second expiry and connection/authorization checks; reconnect with a replacement hello still requests a new name.
The benchmark records browser-frame readiness, exact method/parameter duplicates, RPC request/reply intervals, chunk loads, and renderer thread CPU for all seven requested paths. Each first route visit resets origin storage, owners and HTTP cache. A fixture progress card now belongs only to the requested session, eliminating wrong-target synthetic retries.
Evidence
Current source:
42029f8d9ce6a23e8463ec11317b72e0017c1e83, integrated with mainfade14fea6536384ac6697638d21159175faf424. The shared benchmark conflict preserves both critical-path collection and main’s thread-CPU/selector instrumentation. The later commits only complete the test hello type and add benchmark attribution; shipped UI bundle inputs are unchanged from the integrated build.src/gateway/assistant-human-mentions.tsfailure on the candidate and pinned baseline; no ignore or unrelated deletionb382f0d62ec0d8b97cf7b011b573e9d3904c596f; CI remains recorded as failed.Production: 2,007 → 1,985 lines (−22). Tests/fixtures: 3,827 → 3,967 (+140). Benchmark/docs: 2,445 → 2,925 (+480). The growth is reusable measurement instrumentation and regression proof.
CI repair and baseline attribution
Prior run 40079389784 found one PR defect: the new reconnect tests assigned an incomplete hello fixture to the real Gateway type. The fixture now satisfies
GatewayHelloOk; the exact failing core UI-pages test typecheck passes. No runtime guard or cast was added.The six E2E failures in both that run and final-head run 40081368160 match exact names and errors in scheduled main 40078639310 at
ee855ce57341. They cover active-turn navigation, delayed archive Undo after navigation, model-provider headroom's Usage link, Models-to-Usage layout at 400/820 px, and sidebar pin/unpin persistence. The first two also fail independently on clean exact merge basefade14fea653. The active-turn diagnostic shows Usage throwing on an incompletesessions.usagemock (aggregates.costDaily), rather than delayed routing. These remain reported failures; no assertions, timeouts, or expected-failure lists were weakened.Exact inherited cases:
ui/src/e2e/session-management.archive-undo.e2e.test.ts— Control UI session management mocked Gateway E2E > offers Undo when an individual archive completes after navigate on the Sessions pageui/src/e2e/chat-active-turn-recovery.e2e.test.ts— active turn recovery > restores the active assistant and tool after navigationui/src/e2e/settings-exit-layout-shift.e2e.test.ts— Settings exit layout shift > keeps the shell still from Models to /usage at 400pxui/src/e2e/settings-exit-layout-shift.e2e.test.ts— Settings exit layout shift > keeps the shell still from Models to /usage at 820pxui/src/e2e/sidebar-customization.e2e.test.ts— Control UI sidebar customization mocked Gateway E2E > pins and unpins routes and persists navigation state across reloadsui/src/e2e/model-providers-studio-shape.e2e.test.ts— Control UI Model providers studio-shaped data mocked Gateway E2E > shows plan headroom per provider and leaves local usage to the Usage pageSolid refactor census for the touched Cron renderer and removed entry:
createEffect1→1,createMemo1→1; render effects, untrack, direct listeners, DOM queries, flush, owner APIs and component cleanup remain 0. The route remains lazy; the serial entry/renderer import chain changes from two modules to one. Existing effect ownership and loading presentation are retained.Performance experiment and its limits
Cron CPU-tail follow-through: the original local Task p95 increase prompted four separate profiled pairs and one final 20-pair, normal-instrumentation Cron-only comparison against the same original bundles. The final 20 pairs reduce Task median/p95 by 5.00%/1.44% and Thread median/p95 by 5.12%/1.79%; no pair increases total Task by more than 14.39% or Thread by more than 12.56%. Script median/p95 changes +0.32%/+3.60%. All samples retain five RPCs, 24,153 RPC bytes, zero duplicates and zero carry-in requests. Host one-minute load median is 50.40 (39.05–63.34).
Across all 40 unprofiled pairs, Task median is −1.91% and p95 is +17.34%; Script median/p95 is +0.45%/+7.57%. The original +43.59% Task tail remains unexplained and visible below—it was not discarded or conclusively attributed to instrumentation. It did not repeat in either half of the new run (Task p95 +0.36%/+1.50%), and the full new run's total CPU tails improve. On that repeated evidence, the lazy-entry deletion is retained; this is not a claim that every historical tail improves.
The four profiled pairs are attribution-only: native trace samples show paint/prepaint/commit and scheduler work, no large compilation or GC burst. Profiling disables existing owner counters, so those runs are not pooled with unprofiled results and cannot prove the old outliers' cause. The benchmark now records compile, DevTools, other-task and thread CPU, and supports destination-specific profiles that begin after navigation preparation. The added instrumentation is outside shipped UI bundles. Final local Cron readiness is 663.95 → 564.90 ms median and 1,987.21 → 1,282.96 ms p95; wall results remain descriptive on this loaded host.
The 20-pair experiment below is pinned to base
1adbd71472eand measured candidate source182dc5467b2a, before the final main integration and machine-info reuse change. It is prior-head evidence, not final-head readiness/CPU timing. Final integration has fresh build-size proof, bounded browser verification and exact-head CI; the full timing campaign was not repeated over main’s independent CSS/runtime changes.Automations removes one sequential chunk and improved median readiness 440.9 → 394.1 ms locally and 1,127.6 → 991.1 ms remotely (remote p95 1,673.9 → 1,181.3 ms). Other wall cells are not uniformly faster. Shared-host A/A controls exceed the wall timing band, so those values are descriptive. All 20-pair Script/Task paired medians remain within the +5% band; the pooled cold-Chat/local Script median is +5.7%, while its paired median is +2.4% against +2.5% in the identical-bundle control. Local Task p95 rises 27.4%/27.6%/43.6% on Sessions/Settings/Cron; those tails remain visible, with near-flat medians, unchanged request counts and noisy controls. This is not a claim that every latency or CPU tail improved.
Two candidate remote samples reconnect after readiness: Chat becomes ready at 2,295.6 ms and reconnects at 4,055.6 ms; New Session becomes ready at 1,201.3 ms and reconnects at 3,026.9 ms. All samples and their duplicate/RPC/idle-tail CPU costs remain included. Similar reconnects occur in the New Session A/A control. The normal retained-pane switch need not release its old subscription; its timing is not credited to the deferred-release fix.
These use production bundles with the existing synthetic Gateway. The remote profile models a 100 ms RPC floor plus separate 10 Mbps HTTP and serialized reply/event pipes; it does not model shared-link contention, outbound request bandwidth or real server/provider processing. “Cold” resets browser origin/cache state, not the browser process, V8 or OS caches. New Session readiness means the enabled composer, not every Start submission gate. CPU includes secondary work through the idle tail.
The target of eliminating every avoidable waterfall is not fully met. Sessions still admits its managed list after mount to retain query intent. Cron still owns initial list/status state in its mounted page; moving these reads before the chunk needs a handoff of that same scoped owner and its receipts. Agents is already usable before identity/model replies, so prefetching them would only move secondary work. Appearance retains a secondary system-info/model admission chain. Hovercard prefetch intentionally overlaps hover dwell and is preserved to avoid adding intentional-hover latency.
All readiness/CPU/count tables, calibration and provenance
Request critical-path measurements
COMPLETE. Updated 2026-10-24T08:42:22.984904+00:00. All numeric tables use complete odd/base–even/head pairs only; pending rows are unmeasured, not zero. Final AB target: 20 interleaved pairs per path/profile, combined from two batches of ten pairs. A/A controls use ten identical-base pairs per profile, with separate Chat and New Session boot jobs.
Pinned comparison base:
1adbd71472e; movingorigin/mainis not used for attribution. Candidate source revision:182dc5467b2a7b80344fa5a9cd8ca64060186bff. The candidate bundle was built from the merged working tree before commit and embeds62d2ac5d0e8withdirty: true(build time 07:22:30Z); the base embeds clean1adbd71472e(07:22:39Z). Harnesssummary.headis its starting checkout identity, not necessarily the embedded bundle revision. Host: Apple M3 Ultra, 32 CPUs, macOS 27.0.1, Node 26.12.1. Workload: production Control UI, Headless Chromium, the existing synthetic Team-scale Gateway fixture, fixed fixture clock, first-load documents, and separate fresh boot owners before each first route visit. Local uses--latency-ms 0; remote uses--latency-ms 100 --network-latency-ms 100 --download-kbps 10000 --cold-http-cache. Both profiles use--thread-cpu-time. In remote critical-path mode the selected 10 Mbps rate applies to HTTP and to serialized synthetic WebSocket reply/event bytes after response eligibility; the RPC latency remains 100 ms. HTTP and WebSocket traffic use separate simulated pipes rather than one shared physical link, and outbound WebSocket request bandwidth is not modeled. No live Gateway or provider performance is measured.Readiness is the first browser animation frame where the named visible controls are enabled: transcript plus composer for Chat/switch, message composer for New Session, first row plus Refresh for Sessions/Cron, Appearance font control plus settings search for Settings, and agent panel plus Refresh for Agents. For New Session this times only the visible enabled message composer, not all Start submission gates; request counts and CPU still include idle-tail metadata. It is not INP or a compositor paint timestamp. Script/Task CPU uses Chromium Performance metrics with
--thread-cpu-time(timeDomain: threadTicks), excluding renderer descheduling, through the subsequent idle capture including secondary work; it is not CPU restricted to the readiness instant. Stack/resource instrumentation is enabled equally on both sides; tracing and CPU sampling profiler are disabled.Readiness (milliseconds)
Renderer CPU changes
Paired CPU medians below compare each candidate run with its immediately preceding base run; the pooled medians and tails above remain unchanged. This also exposes shared-host drift without discarding slow samples.
Identical-bundle controls and host load
Completed A/A readiness cells outside the timing band: Cold Chat (local), Cold New Session composer (local), Sessions (local), Settings / Appearance (local), Agents (local), Cold New Session composer (remote), Settings / Appearance (remote). These establish wall-time noise; timing differences alone in those cells cannot establish an improvement or regression. Assess the full 20-pair AB CPU distributions and structural request evidence before concluding.
Dedicated New Session A/A controls are included above and must complete before this report is marked COMPLETE; a missing control is pending evidence. In the completed New-remote control, runs 6 and 14 reconnect after the composer is ready: each captures 87 RPCs rather than the usual 59 and 24 identical-request extras. Their idle-tail CPU includes reconnect work. New-local control
sessions.describecounts vary from 0 to 30. All samples remain included; these count/tail differences already occur with identical bundles.Request counts
Counts span the action and idle capture. Different methods or parameters are different requests. Duplicate counts below are identical method/parameter extras within one interaction; concurrency is recorded separately in the JSON report.
Method-level count differences observed so far: Cold Chat/remote:
agent.identity.getmedian 1→1, range 1–1→1–2; Cold Chat/remote:agents.listmedian 1→1, range 1–1→1–2; Cold Chat/remote:artifacts.listmedian 1→1, range 1–1→1–2; Cold Chat/remote:board.getmedian 1→1, range 1–1→1–2; Cold Chat/remote:chat.startupmedian 1→1, range 1–1→1–2; Cold Chat/remote:connectmedian 1→1, range 1–1→1–2; Cold Chat/remote:cron.listmedian 2→2, range 2–2→2–4; Cold Chat/remote:cron.statusmedian 1→1, range 1–1→1–2; Cold Chat/remote:exec.approval.listmedian 1→1, range 1–1→1–2; Cold Chat/remote:models.authStatusmedian 1→1, range 1–1→1–2; Cold Chat/remote:models.listmedian 1→1, range 1–1→1–2; Cold Chat/remote:openclaw.approval.listmedian 1→1, range 1–1→1–2; Cold Chat/remote:plugin.approval.listmedian 1→1, range 1–1→1–2; Cold Chat/remote:plugins.controlUi.listmedian 1→1, range 1–1→1–2; Cold Chat/remote:plugins.controlUi.reportmedian 1→1, range 1–1→1–2; Cold Chat/remote:progressCard.getmedian 1→1, range 1–1→1–2; Cold Chat/remote:question.listmedian 1→1, range 1–1→1–2; Cold Chat/remote:session.members.listEvidencemedian 1→1, range 1–1→1–2; Cold Chat/remote:session.reactions.listmedian 1→1, range 1–1→1–2; Cold Chat/remote:sessions.branches.listmedian 1→1, range 1–1→1–2; Cold Chat/remote:sessions.catalog.listmedian 1→1, range 1–1→1–2; Cold Chat/remote:sessions.companion.statemedian 1→1, range 1–1→1–2; Cold Chat/remote:sessions.describemedian 30→30.5, range 30–31→30–34; Cold Chat/remote:sessions.groups.defaultsmedian 1→1, range 1–1→1–2; Cold Chat/remote:sessions.groups.listmedian 1→1, range 1–1→1–2; Cold Chat/remote:sessions.listmedian 5→5, range 5–5→5–6; Cold Chat/remote:sessions.messages.subscribemedian 1→1, range 1–1→1–2; Cold Chat/remote:sessions.processes.listmedian 1→1, range 1–1→1–2; Cold Chat/remote:sessions.subscribemedian 1→1, range 1–1→1–2; Cold Chat/remote:system.infomedian 1→1, range 1–1→1–2; Cold Chat/remote:talk.catalogmedian 1→1, range 1–1→1–2; Cold Chat/remote:talk.configmedian 1→1, range 1–1→1–2; Cold Chat/remote:update.statusmedian 1→1, range 1–1→1–2; Cold Chat/remote:users.listmedian 1→1, range 1–1→1–2; Cold Chat/remote:users.prefs.getmedian 0→0, range 0–0→0–1; Cold New Session composer/local:users.prefs.getmedian 2→2, range 1–2→2–2; Cold New Session composer/remote:agent.identity.getmedian 1→1, range 1–1→1–2; Cold New Session composer/remote:agents.listmedian 1→1, range 1–1→1–2; Cold New Session composer/remote:connectmedian 1→1, range 1–1→1–2; Cold New Session composer/remote:cron.listmedian 1→1, range 1–1→1–2; Cold New Session composer/remote:cron.statusmedian 1→1, range 1–1→1–2; Cold New Session composer/remote:environments.listmedian 1→1, range 1–1→1–3; Cold New Session composer/remote:exec.approval.listmedian 1→1, range 1–1→1–2; Cold New Session composer/remote:models.authStatusmedian 1→1, range 1–1→1–2; Cold New Session composer/remote:models.listmedian 1→1, range 1–1→1–2; Cold New Session composer/remote:openclaw.approval.listmedian 1→1, range 1–1→1–2; Cold New Session composer/remote:plugin.approval.listmedian 1→1, range 1–1→1–2; Cold New Session composer/remote:plugins.controlUi.listmedian 1→1, range 1–1→1–2; Cold New Session composer/remote:plugins.controlUi.reportmedian 1→1, range 0–1→1–1; Cold New Session composer/remote:sessions.catalog.listmedian 1→1, range 1–1→1–2; Cold New Session composer/remote:sessions.describemedian 30→30, range 3–30→30–32; Cold New Session composer/remote:sessions.groups.defaultsmedian 1→1, range 1–1→1–2; Cold New Session composer/remote:sessions.groups.listmedian 1→1, range 1–1→1–2; Cold New Session composer/remote:sessions.listmedian 4→4, range 1–4→4–5; Cold New Session composer/remote:sessions.subscribemedian 1→1, range 1–1→1–2; Cold New Session composer/remote:system.infomedian 1→1, range 1–1→1–2; Cold New Session composer/remote:talk.catalogmedian 1→1, range 1–1→1–2; Cold New Session composer/remote:talk.configmedian 1→1, range 1–1→1–2; Cold New Session composer/remote:update.statusmedian 1→1, range 1–1→1–2; Cold New Session composer/remote:users.listmedian 1→1, range 1–1→1–2; Cold New Session composer/remote:users.prefs.getmedian 1→1, range 1–2→1–3; Cold New Session composer/remote:users.prefs.setmedian 1→1, range 1–1→1–2; Session switch/local:chat.historymedian 0→0, range 0–0→0–1; Session switch/remote:progressCard.getmedian 2→2, range 1–2→2–2.The intended scheduling changes need not lower RPC totals:
config.getandconfig.schemabegin together; Sessions no longer waits forconfig.get; a previous session’ssessions.messages.unsubscribeacknowledgment no longer delays the next subscription’s readiness; Cron removes a lazy entry-module hop. The current page keeps ownership and receives the same required data.Scope and remaining work
This PR removes identified scheduling dependencies; it does not demonstrate that every avoidable waterfall is gone. Source-backed before/after diagrams are retained in
.artifacts/rpc-source-graphs.md. Sessions still starts its managedsessions.listwindow after its page chunk mounts. First-entry prefetch could use that existing owner, but must preserve retained page search/status/query intent. Agents preloadsagents.list; config, identity, and selected-panel reads still start at mount. The measured Agents panel becomes usable before identity/model responses, so advancing those secondary reads would not shorten this readiness boundary. Selected-model reads also require the correctly resolved settings-agent scope.Cron still admits its parallel initial
cron.list,cron.status,cron.runs,channels.status, andmodels.listreads after its page chunk. Moving jobs/status earlier requires transferring the same page-owned Cron state and receipts rather than a second cache. Secondary inventories can be deferred or use their existing shared owners. Appearance retains the secondarysystem.info→models.listdependency for observer-model controls; model parameters do not depend on the returned status, but a follow-up must preserve its access/availability contract.All per-sample median/p95/min/max distributions, paired changes, method counts, and completed-job status are regenerated by
python3 .artifacts/analyze-rpc-campaign.pyandpython3 .artifacts/render-rpc-measurement.py; source data stays in.artifacts/rpc-campaign-v3/. Superseded v2 A/A output remains in.artifacts/rpc-campaign-v2-analysis/and is not mixed with this campaign. Failed jobs or incomplete pairs are never presented as completed evidence.Visual proof
Current integrated-main baseline and candidate Automations screenshots use synthetic data. Layout and controls are preserved.
Build provenance: the candidate build started from the reviewed merged working tree before commit
0952cf6b876a, so its embedded launcher label is182dc5467b2a; the source remained unchanged through the build. The strict comparison ran after successful artifact promotion. No rebuild was done solely to polish the embedded label.