Repository navigation
perf(control-ui): send sidebar session row deltas - #172946
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: needs changes before merge. What this changesThis PR adds optional membership churn and response tracing to the Team-scale Control UI benchmark. Example: A signed-in dashboard receives ownership and membership changes across two 200-row sidebar windows.
Review scores
ProductKind: Test only · Worth it: Yes Merge readiness⛔ Needs changes before merge - 1 item remains Keep this maintainer-owned experiment open under its explicit do-not-merge direction; correct the sidebar response measurement defect before drawing performance conclusions. Priority: P3 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe benchmark loads production Control UI assets against a synthetic Gateway, feeds session events into the real list owners, and records browser traces and response statistics. flowchart LR
A[Synthetic session inventory] --> B[Mock Gateway list responses]
C[Membership churn events] --> A
C --> D[Control UI list owners]
D --> B
B --> D
D --> E[Browser response probes]
E --> F[Benchmark artifacts]
Technical reviewBest possible solution: Make the synthetic sidebar responses match production projection, then use the experiment’s measurements to guide any separate runtime optimization. Do we have a high-confidence way to reproduce the issue? Source confirms that uncertain membership can invalidate both independently paced windows; the added diagnostic exercises that path, but no target code was executed during this review. Is this the best way to solve the issue? Extending the existing benchmark is appropriate for this investigation, provided its synthetic wire responses honor the production sidebar projection. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f41b2b656be5. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +476, Other +152. Total +628 across 5 files. Added test files: 1. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. 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 15, 2026, 4:49 AM ET / 08:49 UTC. |
918f03f to
4833669
Compare
5204c01 to
8a823b1
Compare
8a823b1 to
1ac2817
Compare
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. |
…nclaw#172946) Sidebar sessions.list refreshes can now ask for a delta against the client's last revision (ifRowsRevision: delta:<revision>). When the Gateway still retains that base window it returns only changed/inserted rows plus the complete window order; otherwise it falls back to the full list. Older Gateways treat the prefixed token as a revision miss and send the full list. Root cause of Team's paired 5-second refreshes (full audit in the PR): events that cannot certify filtered membership (new cron/subagent/other-user rows entering the window, owner/pin/archive changes) correctly force authoritative refreshes of both sidebar windows, and each window's independent coordinator paces them on a 5 s cooldown. Refreshes stay authoritative; only the payload shrinks. Seven interleaved AWS pairs with a Team-realistic event stream: refresh response bytes 759 KB -> 167 KB (-78%), changed replies carry 5-6 rows instead of 200+; client response-task time unchanged (79 ms). Runtime +60 LOC; the rest is bench/fixture/tests. CI red only on the unrelated web-awesome theme palette assertion, reproduced on main.
…olved peer identity; realign quota catalog e2e (#187594) * test(ui): expect held catalog refresh to complete across quota recovery Backport e8dd49e (#185250, main 77af976) keeps the prepared runtime and its catalog owner through cooldown/blocked availability updates, so a quota recovery no longer supersedes an in-flight catalog generation. The automatic-during-catalog quota e2e still expected the held models.list refresh to fail with "catalog generation was superseded". Main realigned this assertion to the intended behavior in fc0e45a (#184971); that commit is a large CI change, so carry only the assertion: the held refresh resolves ok and the published catalog still reports gpt-5.5 available after it lands. Refs fc0e45a * fix(control-ui): keep the admitted sidebar scope while hello identity is unresolved Backport 99e458b (#185762, main 8d0f6fb) stopped an unresolved peer tab from persisting a profile-less boot record, but on main that fix sits on top of #179254 (5b1b96b), which also keeps the admitted boot profile in the sidebar snapshot scope until hello's selfUser resolves. Release lacks #179254 (Solid-era handoff/perf work), so a peer tab that booted with the operator's sidebar scope still recomputed profileId as null on hello, retired that scope, and deleted the operator's cached sidebar snapshot. The next reload then rendered the sidebar live instead of from cache. Port only #179254's identity rule into the Lit SidebarSnapshotController: keep the admitted profile while selfUser is undefined (a resolved different user or an explicit null still replaces the scope) and skip capture under a profile scope until identity resolves. Add main's unit regression adapted to the release controller (fails without the runtime change). The #185762 e2e waited for an 11th recent row, which main serves through its #172946 sessions.list owner fixture; the backport dropped those handlers, so the count could never be reached on release (it failed at 99e458b itself). Assert instead that the cached reload shows the rows the operator's page saved, which exceeds the single live row a held connect renders. Refs 5b1b96b
What Problem This Solves
A signed-in reload of a dashboard deep link can keep receiving two large sidebar windows after boot. The campaign's October 15 census recorded roughly 325 KB and 151 KB responses near 9 s and 15 s, despite conditional row revisions. A single changed row invalidates the complete-vector revision.
The source trace explains the pair: unsafe membership events invalidate both the canonical owner-first window and the observed involving-me window. Their independent coordinators collect for 4–5 seconds and enforce a minimum 5-second cooldown. Unknown recent sessions, ownership/involvement changes, removals and broad sharing notices require authoritative selection; bounded event snapshots cannot always prove membership or refill a window. These are event-driven reads, not unconditional polling.
This change cuts recurring bytes substantially. It does not demonstrate a material reduction in total response-task time.
Complete source trigger audit (checked through main 801d463)
Request and lifecycle entry points
Paths are relative to
ui/src/. “Pair” means capable of refreshing both canonical primary and an observed filtered sidebar window; it does not imply every invocation does so.requestSessionListParams; connected scope remains currentclient.request("sessions.list", …). Sidebar requests reuse raw per-client/per-queryifRowsRevision; unchanged response reuses raw rows. No timer here.pageSizeand requested limit greater than pageSize, current scope, previous page hasMore and nonempty rowsreason:createexpedites; other reasons paced.Event admission: exact conditions that retain authority
The primary uses
canApplyPrimarySnapshot, requiring live/non-error/non-cached state. Managed windows use the samecanApplySessionListSnapshot, additionally requiring current connectionEpoch and no error. All references here arelib/sessions/session-list-query.ts.ancestorSessionRefsmust resolve against admitted held content revisions through row reconciliation.Similar clocks that do not request the root pair
session-data-controller-catalog.ts:266-284).catalog.ts:211-229,254-260;app-sidebar-session-catalog-live.ts:380,419-428).catalog.ts:286-298).session-lineage-controller.ts:378-499;app-sidebar-child-session-data.ts:61-130).session-data-controller.ts:628-679;lib/sessions/child-session-data.ts:10-18).app-sidebar-personal-navigation.ts:90-209).sidebar-people.runtime.ts:228;person-activity-data.ts:61-88).sidebar-owner-session-counts.ts:7-20,81-101;app-sidebar-online.tsx:268).lib/agents/roster-activity-store.ts:109,168-181,204-245).sidebar-navigation-catalog.ts:50-80).lib/sessions/index.ts:541-545;session-data-controller-events.ts:239-256).index.ts:551-553,569-571).Additional capability callers and Gateway producers
sessions.patchreconciles membership unlessdeferListRefreshor a confirmed patch containing onlyunread:false. Category (+ optional pinned) uses background category reconciliation; uncertain category transport also reconciles.session-mutations.ts:305-438.session-mutations.ts:448-551.session-scoped-operations.ts:49-61,159-208.session-group-catalog.ts:276-291;index.ts:293.session-mutation-refresh.ts:24-53.session-deletions.ts:151-167,268-274,387-391.session-reconciliation.ts:272-288;index.ts:415-433.session-primary-windows.ts:46-84,124-138;session-roster-refresh.ts:568-594;session-managed-list-refresh.ts:342-363.ui/src/plugins/control-ui-host.ts:155-159,207-224.session-placement-startup.runtime.ts:253-256.chat-state-events.ts:181-211;chat-state-refresh.ts:109-123;retained-presentation.ts:479-489;tool-stream.ts:98-109. These calls alone do not force the managed pair.session-roster-refresh.ts:223-231.reason:sharingfollowed by broad keyless/agentlessreason:sharingso revoked recipients can drop inaccessible rows. Broad notice necessarily invalidates both windows.src/gateway/server-methods/sessions-sharing.ts:158-165.reason:owner; changed owner cannot apply to held membership/order locally.src/gateway/server-methods/sessions-mutations.ts:499-504.src/gateway/server-methods/session-change-event.ts:150-199.agent-run-execution-phase.ts:318-337,586-595;session-change-event.ts:399-420.sessions-patch-effects.ts:50-60.Involving-me removal is not derivable from participant omission: Gateway row participants are bounded to four (expanded to 32), whereas its authoritative membership index also includes mentions and explicit involvement states (
session-utils-row.ts:374-393;session-row-selection.ts:91-119). This is a concrete reason to retain authority for those triggers.Change
Keep authoritative refreshes and extend the existing bounded Gateway presentation owner with one previous immutable vector. Clients opt in through the existing
ifRowsRevisionstring, usingdelta:<revision>. A retained exact base permits changed/inserted rows plus complete positional order; omitted base positions leave the window. Positional references also preserve duplicate raw session keys across agents.Current authorization and selection precede encoding. The UI expands response-local facts and reconstructs the full raw window in its existing request cache before capability reconciliation. Counts, facets, defaults and pagination remain current. There is no second list cache, configuration option, protocol version change or durable-state change.
Bare revisions retain full/unchanged behavior. Older Gateways treat the prefixed token as a miss and return full rows. Missing/retired history and broad projection resets also fall back to full rows.
Evidence
Head:
1ac2817c850e92cb55c34e3c5d0ce384088f6e62. Seven interleaved full/delta pairs on one quiet AWSc7a.4xlargelease (cbx_41da50e8b73e, 16 vCPUs, AMD EPYC 9R14, about 30 GiB usable RAM), using the repository's headless Chromium. The pre-comparison interval was 100% idle with no swap or steal.The Team-scale fixture has 300 sessions, 120 people, 30 pins and 12 inline widgets. Its 125 mixed events over 20 seconds include authoritative inventory mutations before publishing new cron/subagent/other-user sessions, window entry/exit, owner/involvement, archive/delete and sharing events. Each capture includes a further 16-second drain. Delivery injection is 35 ms with a 4 ms frame gap. Every run reproduced three sustained conditional request pairs after six seconds, matching request starts within 2.5 seconds (half the minimum cooldown).
Both modes use the same final client bundle and production row packer; availability of the prior vector selects full versus delta responses. This isolates the wire-format effect. It does not measure real Gateway selection/projection CPU or production history-hit frequency. Fixture rows are smaller than the census rows; these are fixture byte measurements.
Metrics cover the 36-second post-boot live phase. Per-refresh values are medians of seven per-run medians; capture totals are medians of seven run totals. Brackets give Q1–Q3. Per-refresh rows, bytes and task times cover conditional replies with changed or removed rows. Capture totals include every reply, including the first primary cache miss and unchanged trailing reads. KB means 1,000 bytes.
Changed-window replies are about 90% smaller; total sidebar wire bytes fall 78%. Total response-task time is effectively flat. This is a bandwidth improvement; the remaining client projection/reconciliation work still needs separate attribution.
Refresh counts do not fall. Owner-first has 4 [4–4] reads per capture in both modes; involving-me has 5 [4–5] versus 5 [5–5]. Normalized to the 20-second active stream, these are 12 [12–12] and 15 [12–15] versus 12 [12–12] and 15 [15–15] reads/minute. These are short-stream normalizations, not observed continuous-minute rates. Across the complete 36-second captures, median rates are approximately 6.66 and 8.33 reads/minute in both modes. Median request intervals remain about 5.1–5.2 seconds; unchanged trailing replies account for the boundary variation.
The timing metric is the instrumented renderer task containing application JSON parse and reconciliation microtasks. Common probe hooks are included; later animation-frame rendering and Node IPC are excluded. It is not an isolated JSON-parser measurement.
Quiet AWS run and proof logs.
Synthetic final-state screenshots
Both captures use the same final client build and synthetic data. The control receives full windows; the candidate receives deltas. No visual design change is intended.
Validation
Independent review is clean through P2. Final-head core, UI, benchmark and affected UI-test typechecks pass, as do focused lint/format checks and the Node-to-Chromium serialization smoke.
All 86 tests across seven focused files pass on the same AWS lease. New/changed test-file wall times, each run with
pnpm test <file> --maxWorkers=1:src/gateway/session-list-delta.test.tsui/src/lib/sessions/session-list-enrichment.test.tsui/src/lib/sessions/session-roster-refresh.test.tsui/src/lib/sessions/sidebar-list-churn.test.tsui/src/test-helpers/control-ui-cold-load-probes.browser.test.tsThe Gateway file includes cold shared-worker compilation; its integration case takes 2.50 seconds. It exercises the actual list handler with one synthetic state fixture. Tests cover insert/remove/refill/reorder, revision misses, limits/pages, owner and involving-me filters, disclosure revocation, reset fallback, response-local facts, overlapping reads and older-server responses. Related serialization (9 tests, 21.40 s) and event-refresh (32 tests, 10.82 s) files also pass.
Exact-head CI: run 38735589749 is complete. All four selected UI e2e shards, production/test typechecks, lint, protocol, performance and other checks pass.
checks-ui (2/3)fails onlyweb-awesome-theme.browser.test.tsx:207: expectedrgb(139, 139, 148), receivedoklab(0.677847 0.00159857 -0.00533658). The same file, line and exact expected/received values fail on pre-fix mainad95e29cdac0when replaying the recorded CI inventory, Bun runtime, shard and worker count: 616 files pass, one fails; 6,832 tests pass, one fails, three skip (162.05 s wall). This is an inherited failure; no CI rerun has been requested.Full UI e2e on the final head: all 801 files ran: 794 passed, 6 failed, 1 skipped; 3,492 tests: 3,483 passed, 4 failed, 5 skipped, in 6,638.87 s. The complete verbose pass/fail inventory is retained with the AWS run linked above.
ui/src/e2e/browser-talk-start-stop.e2e.test.tsdisposition: "abort". Same assertion reproduces on pre-fix main at line 998, 9 passed / 1 failed (54.02 s wall).ui/src/e2e/chat-video-compression.e2e.test.tsui/src/e2e/initial-connect-splash.e2e.test.tsextensions/qa-lab/src/control-ui-automation-management.real-gateway.e2e.test.tsui/src/pages/workboard/workboard-native-bundle.e2e.test.tsui/src/e2e/tooltip-first-activation.e2e.test.tsThe prerequisite replays use the same candidate lease: WebKit replay and final export scan, private artifact replay. An intermediate attempt placed artifacts outside the repository, which the QA fixture rejects; that failed setup attempt is excluded from product conclusions.
Pre-fix-main comparison, pinned to
ad95e29cdac09d711f5fd1ff3be44a13b4055a5e, uses a freshc7a.4xlargelease (cbx_90cc81b43219). The QA automation file also passes both cases on that baseline (372.37 s wall) with the private artifact setup. Main independently repaired the unrelated browser fixtures in354f067a3638(idle/hover theme assertions),9e3514ae247c(video status/alert assertions) andc476ce6d18cc(Talk abort expectations and atomic splash measurements). The candidate was not rebased or rerun in CI to chase those unrelated failures.The earlier broad changed-file check passed production types, formatting, line caps, lint and other static guards; its mock typing failure was corrected and the affected graph now passes. The final export scan reports ten exports in untouched files (112.04 s). The pinned main scan also fails (108.65 s): five findings match exactly (
assertRecord,createAgentFixture,classifyUnitFastTestFileContent,QuestionPanelQuestion,recommendedIconUrl). Main has independently removed the other five exports or their re-exports:ReadToolContinuationSchema,authorizeSessionSharingTarget,FollowupQueueDisposition,DoctorLintCliOptionsSchema, andrenderMessageGroupContent. None of these files is changed by this PR; no new unused export is introduced by the delta path.The accepted comparison/full-suite command completed and its complete logs, 14 raw traces and 112 MB artifact archive were retained locally. Crabbox's terminal-receipt publication returned HTTP 502; a later receipt lookup still has no committed terminal record. The follow-up runs have normal terminal receipts. The terminal receipt remains unavailable; the raw artifacts and complete command logs remain available.
Production LOC command requested by the campaign:
Result: +928 / -117 = +811 net across 12 files. This includes +60 runtime lines and +751 measurement-harness lines. Runtime growth is required by the optional delta contract and retained full-response compatibility/fallback. The harness growth supplies changing authoritative inventory, paired-refetch verification and response-task attribution; superseded serialization and event-scheduling paths were removed during extraction.
All lane-owned AWS leases were released after artifact collection; no local Gateway was started. Remaining measurement limits are production delta-history hit frequency and real Gateway projection CPU, neither claimed by this PR.