Repository navigation
perf(ui): window agent selector rows and identity reads - #189936
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 maintainer review before merge. What this changesThis PR reuses the shared windowed picker for agent selection and requests identities only for mounted choices and the selected agent. Example: Open a 300-agent selector with agent-250 selected, then press End.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this useful, maintainer-authored draft open: current main still performs full-roster selector work, and no concrete introduced defect was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Control UI consumes the agent roster and selection, renders choices through the shared picker, and sends identity demand to the existing Gateway-scoped identity capability. flowchart TD
A[Agent roster and selection] --> B[Agent selector]
B --> C[Shared picker navigation]
C --> D[Virtual row window]
D --> E[Mounted identity demand]
B --> E
E --> F[Existing identity capability]
Technical reviewBest possible solution: Keep rendering and identity demand proportional to mounted choices through the existing picker and identity owners. Do we have a high-confidence way to reproduce the issue? Pinned main source shows full-roster row/avatar construction on opening and all-roster identity hydration on Agents visits; no target code was executed during this read-only review. Is this the best way to solve the issue? Reusing the existing virtualizer and identity capability addresses the unnecessary work at its owners, with no competing menu implementation or unnecessary production layer identified. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b7d77957a83a. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +103, Tests +166, Other +76. Total +345 across 37 files. Added test files: 0. View PR surface stats
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 31, 2026, 9:50 PM ET / November 1, 2026, 01:50 UTC. |
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. |
|
Merged via squash.
|
What Problem This Solves
The first agent-menu opening rendered all 300 options and their avatars. Visiting Agents also requested identities for the entire roster, even with the menu closed. Reuse the shared picker window so only the visible rows, overscan, and active keyboard target mount; identity reads now follow that mounted window and the selected agent.
Search still filters the complete roster. Home/End and arrow navigation materialize their target before updating
aria-activedescendant; the listbox retains focus. Agent tags, classes, selection callbacks, lazy route boundaries, and fixed avatar geometry remain. The shared picker's default row and trigger markup moved intact to a presentation file; its small-menu selected-row reveal now receives the same geometric correction as the former agent menu.Settings keeps its existing identity effect, and New Session/palette keep their existing plain-owner notifications. No new effect, cache, timer, controller, or copied identity list was added. The Agents detail owner only ensures its selected agent. A direct selected-agent lookup also removes the outgoing draft's repeated full-roster filter allocation. Generic deferred teardown was not justified by the source-mapped evidence and is unchanged.
Evidence
Qualification uses 300 synthetic agents, six first-visit routes (Agents, Advanced, Plugin Settings, Model Providers, Channels, About), standalone first menu open, and navigation through first menu open. The prescribed matrix is 20 serial base/head/base triplets per cell, Chromium 1×/4× and WebKit, desktop/mobile. Same-byte A/A controls identify host noise. Traces are separate; no WebKit CPU claim. Timing acceptance is ≤5% median regression with p95 holding, or further samples resolving a flagged cell. Targets are ≤50 ms / ≤200 ms route tasks at 1×/4×.
Completed qualification: all 2,880 observations passed across 48 cells. Each cell has 20 serial base/head/base triplets, using source-verified frozen bundles. The one-minute host load ranged from 4.82 to 22.05; A/A controls ran within every triplet. Values below are milliseconds: median/p95 [min–max]. WebKit has no supported CPU metric.
Nine follow-up cell runs (ten more triplets each; 270 observations) resolve the headline tail flags without a source change. The 4× desktop Advanced/About and Plugin Settings tail increases did not repeat; Model Providers' residual tail movement was smaller than its A/A movement. Mobile 4× Channels improves in the follow-up; About CPU p95 is within 0.6% and readiness improves. WebKit desktop Plugin Settings readiness p95 improves 12.3%. The first extra 1× Channels run caught one 120 ms readiness sample with ordinary CPU; a further ten triplets improve CPU/readiness p95 by 6.4%/10.9%, with a larger baseline wall-time outlier. The isolated spike is retained rather than removed from the evidence.
These are whole-flow wins, not universal subphase reductions. For example, primary 4× desktop Agents layout p95 grows 5.2 ms (11.1%) while total CPU and readiness improve. The mobile About follow-up has longest-task p95 82→87 ms, whereas the primary result is 93→93 ms; its style median grows 2.1 ms. Small style/layout movements and control-matched WebKit tails remain disclosed, without treating them as additional wins. Chromium records zero CLS throughout the primary head observations; WebKit lacks this observer.
Follow-up cell results (head changes; median/p95)
At 1×, no route visit or standalone opening produced a ≥50 ms long-task entry; the maximum combined-flow task was 60 ms. At 4×, observed maxima were 289 ms for routes (desktop Agents), 56 ms for standalone opening, and 306 ms for the combined flow (mobile). The ≤200 ms route target remains unmet; this PR does not count earlier contaminated maxima as a win.
The remaining observed route maximum is 289 ms on desktop Agents. A separate source-mapped trace reports a 252 ms task: 96 ms initial incoming mount plus a 156 ms microtask checkpoint. Cleanup ancestry accounts for 49 ms of the checkpoint, alongside incoming Agents bindings; these overlapping stack buckets must not be summed. File grammar/parser setup accounts for roughly 18 ms of the initial mount. Earlier full AgentFiles deferral increased first-Files readiness substantially and was rejected. Generic teardown deferral would change subscription/write lifetimes without removing the dominant incoming work. This is an attributed target gap, not a claim of an irreducible browser floor.
An earlier CI dark-theme picker keyboard failure could not be reproduced in the fresh ordinary bundled test: all 13 dark appearances passed with both machine highlight and active-descendant moving correctly. The exact name passes in the full current-head CI. The earlier failure is retained as unexplained intermittent evidence; no assertion or wait was weakened to obtain the pass. No local full E2E/parity suite was run.
Touched production LOC: 6,822→6,924 (+102). Full patch: 876 additions / 494 deletions across 47 files. Growth provides shared-picker render slots and visible-row identity demand for existing consumers, while deleting the parallel menu renderer.
Full primary route matrix (median/p95 and same-byte controls)
chromium-4x: 16/16 cells complete
chromium-1x: 16/16 cells complete
webkit: 16/16 cells complete
Visual proof
Inspected synthetic fixtures from the corrected base/head bundles; left is before, right is after.