Repository navigation
perf(ui): reduce dashboard and chat reload RPC fan-out - #179157
Conversation
|
🦞👀 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. |
97de262 to
33f054e
Compare
Reuse rows that arrive while personal pin lookups wait for foreground bootstrap, and batch browser plugin activation receipts per catalog refresh. Keep healthy plugins available immediately, preserve receipts across superseding refreshes, and retain per-plugin revision validation. Add a reproducible synthetic Gateway fixture and caller-attributed reload census with separate RPC, LoAF, and sidebar inventory measurements.
Use the Gateway request-context factory in the mixed activation-batch test instead of casting a partial context. Expect the complete receipt batch after the peer deadline, and keep the plugin manager mounted while checking its own pending Reload button. Prune the retired loader mock baseline entry. The Gateway plugin-assets file passes all 22 tests and changed-file format and source-only lint pass. CI owns the browser and test-type recheck. The unrelated workboard lint-suppression inventory failure reproduces with the same signature on the unchanged main parent.
33f054e to
fdde14b
Compare
|
Codex review: needs maintainer review before merge. What this changesThis PR skips queued pin lookups when roster rows have arrived and batches browser plugin activation receipts. Example: Reload chat with eight personal pins and seven browser plugins.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR provides a useful, maintainer-directed reduction in reload work, and no concrete introduced correctness defect was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Control UI acquires session rows and plugin catalogs from the Gateway, renders navigation, and returns browser activation observations to the Gateway. flowchart LR
A[Dashboard or chat reload] --> B[Connection bootstrap]
B --> C[Sidebar pin owner]
C --> D[Loaded roster or descriptor RPC]
A --> E[Plugin runtime]
E --> F[Immediate plugin publication]
E --> G[Batched activation receipts]
G --> H[Gateway receipt validation]
Technical reviewBest possible solution: Keep the existing bootstrap and plugin-runtime owners, eliminate obsolete reads, and complete the required performance and upgrade validation. Do we have a high-confidence way to reproduce the issue? Current-main source shows queued descriptions without a loaded-row recheck and separate activation-report requests; the supplied real-Gateway census corroborates those paths, but this review ran no target code. Is this the best way to solve the issue? The implementation is focused: it checks existing row owners at dispatch, batches at the existing plugin runtime, removes the singular-report helper, and preserves Gateway validation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b9c2e13b97c9. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +26, Tests +253, Docs +37, Other +396. Total +712 across 19 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 21, 2026, 4:30 AM ET / 08:30 UTC. |
|
Landing this lane under the authorized inherited-CI-failure exception for exact head The two failing constituent jobs in run 39562170386 have baseline reproductions:
The aggregate CI gate remains red because of these two jobs. No CI rerun or unrelated source repair was used to chase green. This exception does not waive any product, review, or security finding; the PR body records the paired measurements and limitations. |
* perf(ui): reduce dashboard and chat reload RPC fan-out Reuse rows that arrive while personal pin lookups wait for foreground bootstrap, and batch browser plugin activation receipts per catalog refresh. Keep healthy plugins available immediately, preserve receipts across superseding refreshes, and retain per-plugin revision validation. Add a reproducible synthetic Gateway fixture and caller-attributed reload census with separate RPC, LoAF, and sidebar inventory measurements. * test(ui): align reload batching proofs with owner lifetimes Use the Gateway request-context factory in the mixed activation-batch test instead of casting a partial context. Expect the complete receipt batch after the peer deadline, and keep the plugin manager mounted while checking its own pending Reload button. Prune the retired loader mock baseline entry. The Gateway plugin-assets file passes all 22 tests and changed-file format and source-only lint pass. CI owns the browser and test-type recheck. The unrelated workboard lint-suppression inventory failure reproduces with the same signature on the unchanged main parent. * test(ui): use loader spy in rebased publication test
What Problem This Solves
Reloading a dashboard or chat performs avoidable per-pin descriptor reads and one activation-report RPC per browser plugin.
User Impact
Reloading uses fewer Gateway requests while preserving the existing roster, pin navigation, plugin availability, and authoritative refresh behavior.
Why This Change Was Made
Check for a loaded row when a queued pin lookup actually receives the foreground request budget. Rows supplied by the roster during that wait need no descriptor; pins outside held windows still get one.
The plugin runtime publishes healthy plugins immediately and sends their activation receipts as one bounded batch once initializers finish or reach their existing deadline. It includes retained owners when a refresh supersedes an unsent batch. The Gateway keeps its live-client and per-plugin revision checks, records valid peers in a mixed batch, and identifies rejected plugins separately. The old per-plugin report transport method is removed. The coupled UI/Gateway request payload changes together; status results retain their existing per-plugin shape.
Evidence
Acceptance rule recorded before measurement: real isolated Gateway, synthetic 5,000-session roster, seven plugins, eight personal pins, dashboard and chat; first 15 seconds per document; 11 simultaneous baseline/candidate pairs with CPU halves swapped on alternating pairs. Compare per-pair candidate-minus-baseline differences, with cold browser contexts separate from warm reloads. Target 40% fewer requests without blocking regression; retain useful requested simplifications with a smaller nonregressing result.
Diagnostic baseline at
ef6d500b534062f352aa6d7ceef01c97d907c511: 63 RPCs for each route. All 63 requests have distinct full parameters. The eight avoidable pin descriptors wait behind foreground bootstrap; seven activation receipts are independently reported. Current main already uses the shared model catalog (ui/src/lib/model-catalog-store.ts) and its bootstrap snapshot (models.list = 0). Its four list queries have distinct filters. PR subscriptions already deduplicate the sorted active/passive set signature inui/src/lib/session-pull-requests.ts; the three observed sets differ as membership arrives. Those owners retain their authoritative refresh semantics.Final measurement: 11 concurrent A/B pairs, 44 result files, 88 page loads, using pinned Chrome for Testing
156.0.8078.4, without request-stack capture. Each pair swaps the two 16-core CPU halves relative to the preceding pair. All groups contain all 11 pairs; actual A/B start skew is −27 to +44 ms. Across the campaign, requests fall from 2,794 to 2,177 (−617, −22.08%). The median saving is 14 requests per load; one warm dashboard saves 15 because the existing PR-set owner converges with two subscriptions instead of three.Values below are A → B medians; Δ is the median of within-pair B−A differences, not the difference between independent medians. Blocking and row timings are milliseconds.
Decision and limits: the 40% RPC target is not met. The requested removal of avoidable work provides a repeatable ~22% reduction, with no consistent blocking shift across the paired sample; paired blocking means are +6.36, −0.20, +1.04, and −2.84 ms in table order. This is a request-count improvement with neutral central timing, not evidence of a latency or tail improvement. It qualifies under the standing acceptance rule for useful requested changes with timing differences within observed variation.
Keep the tail visible: pair 11 has the largest cold-dashboard blocking on both sides, 203.2 → 325.6 ms (Δ +122.4 ms). The candidate’s largest individual blocking frame is 99.1 ms at 509.7 ms, before its first RPC at 752.2 ms and activation batch at 1,574.1 ms. Candidate FCP and first rows in that pair are 144 and 275.5 ms earlier. CPU-context non-idle means are 13.66%/14.12% for A/B, versus whole-pair means of 3.02%–10.81% in pairs 1–10. These measurements include benchmark work and outside work; they do not establish the spike’s cause. Pair 11 remains included. Eleven pairs cannot rule out a rare tail cost, and no tail-win claim is made.
Every document completes the 15-second window with 10 final sidebar rows; no page errors, cleanup errors, missing replies, late replies, or unknown response outcomes occur. Cold dashboards have one symmetric
talk.catalogwarm-up failure followed by a successful retry on each side (22 such initial failures total); all other requests succeed. The extra cold-dashboard descriptor is a distinct child-navigation query.sessions.describefalls 10→2 there and 9→1 elsewhere;plugins.controlUi.reportfalls 7→1 everywhere.sessions.liststays at four distinct filters andmodels.liststays at zero. The traced census below is the earlier warmed-Gateway diagnostic; the paired cold-dashboard startup additionally includes the child query and the intentional voice-catalog retry.The earlier baseline-runtime path failure and Snap Chromium shared-profile collision were setup failures, not valid comparison pairs. Both attempts are excluded. The final campaign used a sandbox-local pinned browser, with simultaneous distinct-profile launches verified before measurement; no valid timing result was removed or rerun.
All 11 paired native-LoAF differences and CPU context
Blocking columns are B−A milliseconds; CPU columns are mean non-idle percent over the pair, including benchmark work. Odd pairs place A on cores 96–111 and B on 112–127; even pairs swap them.
Proof: pin regression red on baseline and 32/32 focused tests green; batch protocol validation red on baseline; export collision guard and both import-closure files pass (22 tests). UI typecheck passes after explicit activation return correction. Independent review completed with no actionable P0–P2 findings. Gateway plugin asset tests pass (22/22), including mixed-batch live-client/revision validation; protocol validators pass (9/9). Runtime tests pass (20/20), including immediate healthy-plugin availability, superseded batches, transport failures, and per-plugin rejection attribution. The new runtime regression also fails on the original code for the intended early singular-report behavior; changed-file format and lint are green. PR CI supplies broad and E2E validation; no local full suite or test lease was used. A corrective Gateway test run passes all 22 tests using the real request-context factory. Changed-file source-only lint passes; an earlier lint invocation entered declaration preparation and was stopped.
The first PR CI run (39557079735) passed 51 jobs and exposed three test-proof corrections: use the request-context factory instead of a partial cast, assert the complete two-plugin receipt batch while preserving the mounted manager for its pending-button check, and prune the retired loader mock baseline entry. The second run on
33f054e616c39c37a03c8dd9bd0ff1d65987b0b0passes all four browser shards, the Gateway test-type shard, and the baseline ratchet. It exposed one rebase integration issue: #179134’s new runtime test used the retired unqualified mock reference. The correction points it at the existing loader spy, preserves all assertions, passes 21/21 focused runtime tests, and has a clean independent review. Final headfdde14b601619f8c16cf12187f0db64fe346d73bcarries that correction. On that final head, all three UI unit shards and all four browser shards pass. The only failing constituent CI jobs are the two independently reproduced main failures below; the aggregate CI gate remains red because of them.The separate
test/scripts/lint-suppressions.test.tsfailure is inherited. On final headfdde14b601619f8c16cf12187f0db64fe346d73b, job 119096347002 reports 99 entries versus 97. The same exact-file run on unchanged main parenta7800168fc85000fae3ec5c165b08949cf926172reproduces both extra entries:scripts/perf/workboard-read-measure.ts|typescript/unbound-method|1from #179090 andscripts/perf/transcript-worker-memory-preload.ts|typescript/unbound-method|2from #179119. Both runs have 13 passing tests and that one failure; neither implicated file nor the inventory test is changed here. The first PR head and its main parent had already reproduced the earlier 98-versus-97 form before #179119 landed. No CI rerun was requested.The separate test-planner type errors in final-head job 119096825712 are also inherited:
test/scripts/ci-changed-node-test-plan.test.ts:813and:891passCompactNodeTestShardto a helper requiringChangedNodeTestShard(missingconfigs), introduced on main by0f750efb137b. A boundedscripts/run-tsgo.mjsdiagnostic in the isolated Linux sandbox, selecting only that file and the existing declaration globs, reproduces both TS2345 errors againstf29ecf310b2c103dcd9ae70db46df89395170d2binputs. The test, imported planner modules, and config-chain blobs match that main baseline; no additional local typecheck or full tooling lane was run.ClawSweeper reviewed exact head
fdde14b601619f8c16cf12187f0db64fe346d73bwith no actionable findings. Its requested paired measurements are complete above. A latest-stable upgrade was not run: this change does not alter persisted pins, plugin settings, configuration, migrations, or installation/update behavior. The activation receipt is an observation tied to a live browser connection; the existing matched-version UI/Gateway contract owns the coupled wire change. Current-head UI unit and browser CI cover the affected consumers. This is a stated validation limit, not upgrade evidence.Runtime production delta is +26 lines (78 added, 52 removed). The requested batch contract needs a bounded envelope, retained-owner receipts across superseding refreshes, and per-plugin rejection attribution; it removes the old per-plugin transport method and introduces no cache or new state owner. The separate fixture/census tooling makes the real-Gateway measurement reproducible. The requested filtered diff statistic, which also includes benchmark scripts and their README, is 516 insertions / 60 deletions (+456): +431 in measurement tooling/documentation, +26 in runtime code, and one retired mock-baseline line removed.
The UI A/B inputs are exact baseline
f29ecf310b2c103dcd9ae70db46df89395170d2band candidatefdde14b601619f8c16cf12187f0db64fe346d73b, verified in the emitted source maps. Gateway bundles use fixed coreef6d500b534062f352aa6d7ceef01c97d907c511, with the candidate batch-protocol change on B. This isolates reload acquisition on the same core; it is not a complete latest-deployment latency comparison. In particular, the intervening operator-authority optimization in #179165 is absent on both sides.The fixture has realistic roster/run/approval/project counts but only 8 MiB of transcript text; it tests reload acquisition, not multi-gigabyte storage throughput or model inference. First/final rows are observed DOM inventory milestones, not paint or authoritative-freshness claims. No sidebar rendering or activity-polling behavior changes.
Complete baseline RPC census: identical dashboard and chat counts, caller owners, and parameter keys
Every call was captured with an opaque per-document query identity and source-mapped stack. No method in this sample repeated the same complete parameters. Callers below summarize the mapped stacks; parameter values are omitted.
agent.identity.getui/src/app/assistant-identity.ts,ui/src/lib/agents/identity.ts,ui/src/pages/chat/chat-assistant-identity.ts,ui/src/pages/chat/chat-pane-context.tsagents.listui/src/app/app-host.tsx,ui/src/app/app-shell-gateway.ts,ui/src/app/app-shell-navigation.ts,ui/src/lib/agents/index.tsboard.getui/src/lib/board/gateway-provider.ts,ui/src/lib/board/provider.ts,ui/src/pages/chat/chat-pane-board.ts,ui/src/pages/chat/chat-pane-lifecycle.tschat.metadataui/src/lib/chat/chat-metadata-store.ts,ui/src/pages/chat/chat-state-refresh.tschat.startupui/src/pages/chat/chat-history-hydration.ts,ui/src/pages/chat/chat-history-request.tsconnectui/src/api/gateway.ts(connection handshake)controlUi.sessionPullRequests.subscribeui/src/lib/gateway-set-sync-lifecycle.ts,ui/src/lib/session-pull-requests.tscron.listui/src/app/connection-bootstrap.ts,ui/src/components/sidebar-attention-store.ts,ui/src/lib/cron/jobs.tscron.statusui/src/app/connection-bootstrap.ts,ui/src/components/sidebar-attention-store.ts,ui/src/lib/cron/state.tsexec.approval.listui/src/app/connection-bootstrap.ts,ui/src/app/exec-approval.ts,ui/src/app/gateway-observers.ts,ui/src/app/gateway-store.tsmcp.app.discoverui/src/lib/mcp-app-catalog.tsmentions.listui/src/app/mentions.tsmodels.authStatusui/src/lib/model-auth.ts,ui/src/pages/chat/chat-pane-context.ts,ui/src/pages/chat/chat-pane-lifecycle.ts,ui/src/pages/chat/chat-pane-runtime-view.tsxopenclaw.approval.listui/src/app/connection-bootstrap.ts,ui/src/app/exec-approval.ts,ui/src/app/gateway-observers.ts,ui/src/app/gateway-store.tsplugin.approval.listui/src/app/connection-bootstrap.ts,ui/src/app/exec-approval.ts,ui/src/app/gateway-observers.ts,ui/src/app/gateway-store.tsplugin.surface.refreshui/src/app/canvas-surface-lease.runtime.ts,ui/src/app/gateway-canvas-surface.tsplugins.controlUi.listui/src/app/gateway-observers.ts,ui/src/app/gateway-store.ts,ui/src/plugins/control-ui-runtime.tsplugins.controlUi.reportui/src/plugins/control-ui-runtime.tspresence.activityui/src/app/gateway-observers.ts,ui/src/app/gateway-presence-activity.ts,ui/src/app/gateway-store.tsprogressCard.getui/src/lib/reactive/domain-keyed.ts,ui/src/lib/reactive/projection.ts,ui/src/lib/session-progress-cards.tsprojects.listui/src/lib/projects.ts,ui/src/lib/reactive/parked-projection.ts,ui/src/lib/reactive/projection.ts,ui/src/pages/chat/chat-pane-runtime-view.tsxquestion.listui/src/app/question-prompt-client.ts,ui/src/app/question-prompt.ts,ui/src/pages/chat/chat-pane-context.ts,ui/src/pages/chat/chat-pane-lifecycle.tssession.discussion.infoui/src/pages/chat/chat-pane-discussion.ts,ui/src/pages/chat/chat-pane-session.ts,ui/src/pages/chat/performance.tssession.members.listEvidenceui/src/lib/reactive/parked-projection.ts,ui/src/pages/chat/chat-pane-header.ts,ui/src/pages/chat/chat-pane-layout-render.ts,ui/src/pages/chat/chat-pane-render.tssession.reactions.listui/src/lib/reactive/parked-projection.ts,ui/src/pages/chat/chat-pane-lifecycle.ts,ui/src/pages/chat/chat-pane-reactions.ts,ui/src/pages/chat/chat-pane-runtime-view.tsxsessions.branches.listui/src/lib/sessions/session-scoped-operations.ts,ui/src/pages/chat/chat-history-branches.ts,ui/src/pages/chat/chat-pane-session.ts,ui/src/pages/chat/performance.tssessions.catalog.listui/src/app/connection-bootstrap.ts,ui/src/components/app-sidebar-session-catalog-live.ts,ui/src/components/session-data-catalog.ts,ui/src/components/session-data.tssessions.companion.stateui/src/pages/chat/chat-pane-session.ts,ui/src/pages/chat/chat-pane-side-panels.ts,ui/src/pages/chat/chat-session-companion.ts,ui/src/pages/chat/performance.tssessions.describeui/src/app/connection-bootstrap.ts,ui/src/components/app-sidebar-personal-navigation.ts,ui/src/lib/sessions/session-describe.ts,ui/src/pages/chat/chat-pane-active-resources.tssessions.github.optionsui/src/lib/reactive/parked-projection.ts,ui/src/lib/sessions/github-publication-owner.ts,ui/src/pages/chat/chat-pane-render.ts,ui/src/pages/chat/chat-pane-runtime-view.tsxsessions.groups.defaultsui/src/lib/sessions/session-group-catalog.tssessions.groups.listui/src/app/connection-bootstrap.ts,ui/src/lib/sessions/session-group-catalog.tssessions.listui/src/app/connection-bootstrap.ts,ui/src/components/session-data-events.ts,ui/src/components/session-data.ts,ui/src/components/sidebar-owner-session-counts.tssessions.messages.subscribeui/src/lib/sessions/session-scoped-operations.ts,ui/src/pages/chat/chat-history-subscription.ts,ui/src/pages/chat/chat-pane-context.ts,ui/src/pages/chat/chat-pane-lifecycle.tssessions.observer.visibilityui/src/app/bootstrap.ts,ui/src/app/connection-bootstrap.ts,ui/src/pages/chat/chat-observer.tssessions.resolveui/src/app-routes.ts,ui/src/app/bootstrap.ts,ui/src/app/stale-chunk-reload.ts,ui/src/app/startup-lifecycle.tssessions.subscribeui/src/app/gateway-observers.ts,ui/src/app/gateway-store.ts,ui/src/lib/sessions/index.ts,ui/src/lib/sessions/session-event-subscription.tssessions.viewers.setui/src/lib/gateway-set-sync-lifecycle.ts,ui/src/lib/session-viewer-presence.tssystem.infoui/src/lib/system-info.ts,ui/src/pages/chat/chat-pane-session-menu.ts,ui/src/pages/chat/chat-pane-session.ts,ui/src/pages/chat/performance.tstalk.catalogui/src/pages/chat/components/chat-composer.tsx,ui/src/pages/chat/composer-microphone-picker.tstalk.configui/src/pages/chat/components/chat-composer.tsx,ui/src/pages/chat/composer-microphone-picker.tstaskSuggestions.listui/src/pages/chat/chat-pane-session.ts,ui/src/pages/chat/chat-pane-task-suggestions.ts,ui/src/pages/chat/performance.tsupdate.statusui/src/app/connection-bootstrap.ts,ui/src/app/gateway-observers.ts,ui/src/app/gateway-store.ts,ui/src/app/overlays-updates.tsusers.listui/src/components/solid/identity-avatar-view.ts,ui/src/components/solid/identity-avatar.tsx,ui/src/lib/profile-directory.ts,ui/src/lib/reactive/projection.ts