Repository navigation
perf(ui): retain prepared model catalogs across warm updates - #180967
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. |
|
Codex review: needs changes before merge. What this changesThis PR retains catalog-derived model indexes and options across unrelated Control UI updates. Example: Mobile session switching with a 1,000-model catalog.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep this PR open: the maintainer-directed optimization has measurable value, but its added E2E probe introduces a lint failure that needs repair. Priority: P2 Before merge
Findings
Agent review detailsHow this fits togetherGateway catalog snapshots enter the scoped catalog owner, and the composer combines derived catalog facts with live session, policy, and runtime state to render model controls. flowchart TD
A[Gateway catalog snapshot] --> B[Scoped catalog owner]
B --> C[Component catalog memos]
C --> D[Live controls derivation]
E[Session and policy state] --> D
D --> F[Model and effort pickers]
Technical reviewBest possible solution: Retain the component-scoped derivations and move the large-catalog browser scenario into a focused E2E file using the existing suite infrastructure. Do we have a high-confidence way to reproduce the issue? Current-main source rebuilds catalog indexes and option inventories inside the broad controls memo when unrelated props change; the supplied paired browser measurements exercise that path. Is this the best way to solve the issue? The production change is appropriately small: it reuses existing preparation owners, retains only catalog-derived facts, and invalidates them when the published array changes. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 60c9291360c9. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceAcceptance criteria:
What I checked:
PR surfaceSource +12, Tests +85. Total +97 across 4 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 22, 2026, 5:01 PM ET / 21:01 UTC. |
|
Merged via explicitly authorized admin squash with prior CI and scoped validation.
|
…w#180967) * perf(ui): retain prepared model catalogs across warm updates * refactor(ui): simplify prepared catalog parameter * test(ui): discard frame IDs in model interaction probe




What Problem This Solves
The warm session-switch/sidebar-toggle profile rebuilds catalog-only provider indexes, availability filtering, display labels and sorted options for 1,000 models when unrelated control props change. The candidate retains only those prepared catalog facts in component-scoped derivations. Selection, policy, permissions, and session/runtime state remain live. The plain catalog owner replaces its catalog array on publication; no global cache or second state owner is introduced.
Before accepting: production renderer, synthetic Gateway with request-filtered 1,000-session list and two 400-message transcripts, 1,000-model catalog. Desktop 1440×1000 and mobile 390×844. At least 10 serial interleaved AB pairs for session-switch and sidebar-toggle; inspect script/task/layout/style/wall median, p95, min and max. Any >20% regression rejects. Count matching interval RPCs, inspect source-mapped traces and synthetic screenshots, and compare strict base/head boot surfaces with at most 64 B variance.
Paired results
80/80 outcomes passed, no timing-statistic cell regresses by more than 20%. Chromium 156, macOS arm64; 10 serial AB pairs per viewport and step, production renderer/synthetic Gateway, no trace or profiler overhead. Values are median / p95 / min–max milliseconds.
The desktop sidebar interval includes four deferred background reads (one each of chat.history, sessions.processes.list, artifacts.list, cron.list) on both sides. Session switching includes four progressCard.get reads on both sides. Mobile sidebar issues no requests. These are automation-to-assertion totals, not INP or isolated handler latency. The change removes catalog rebuilding; it does not change these requests or the existing sidebar animation.
Evidence
Both pairing bundles included the same complete spacing-selector fix; only catalog preparation differed. The production owner still replaces catalog arrays, and session, policy, runtime, capability, and selection remain live. The final source simplifies the optional prepared parameter without changing default evaluation; independent review confirmed that equivalence.
ci:full; no local E2E suiteAll boot deltas are within the 64 B build-variance allowance. Production LOC: 1,144 → 1,156 (+12); all changed files: 2,308 → 2,407 (+99), including one rendered-behavior regression and a report-only sidebar probe. No new effect, listener, owner API, flush, manual import, or synchronized state. Three derivation memos retain the catalog reference, provider index, and prepared option inventory.
The existing 1,000-model E2E case records a warmed sidebar close/open at 1280×900, checks the selected model survives, and checks that no extra catalog RPC occurs. It retains normal animation and reports script/task/layout/style time without a threshold. This probe is separate from the 1440×1000 and 390×844 AB calibration.
Reproduction:
scripts/bench-control-ui-interactions.ts --bundle-dir <base> --compare-bundle-dir <head> --steps session-switch,sidebar-toggle --pairs 10. Add--tracefor source-mapped diagnostics. Strict asset comparison usesscripts/check-control-ui-performance.mts --dist <head> --base-dist <base>afterpnpm ui:buildfor both source states.Inspected synthetic before/after screenshots: #180967 (comment)
Production Knip fails with the same 13 unused-export groups and 11 exported-type groups on this head and exact merge base
fdf6d47e645b118e5c3ee935f0a96a7bddd499da; outputs are byte-identical. No listed symbol is modified by this diff, and no ignore was added.CI repair: the first run caught two
no-promise-executor-returnerrors in the report-only browser probe. Both callbacks now use block bodies; frame scheduling and resolution are unchanged. Scoped lint/format and independent P0–P2 review pass. Production and paired-measurement inputs are unchanged.Post-merge combined census
Revision
97be272075c796d10d4c0c4f9ec39d6d7c4c97be: 30/30 scenarios pass (15 actions × desktop/mobile), no skips. Synthetic Gateway: 1,000 sessions, two 400-message transcripts, 1,000 models, 500 Cron jobs. Chromium 156 on macOS arm64. One diagnostic sample per cell, CDP trace plus 1 ms CPU sampling; overhead included. This ranks residual work, not a new paired latency claim. All time values are milliseconds; D/M means desktop/mobile. Sorted by maximum main-thread busy time.No forced synchronous layouts were recorded. Residual desktop sidebar work includes its existing width animation. Ordinary Cron typing includes 11 interval requests on desktop and five on mobile; the held-request probe isolates rendering with exactly one request and zero long tasks. Model search retains two long tasks per viewport. The Sessions/Cron opening spikes in the original faulty dashboard fixture are not claimed as product gains.
Final same-machine landing-parent asset comparison (
e875ec9c918c→97be272075c7): startup JS 316,423 → 316,380 B (−43 B), seven requests; CSS 41,145 → 41,145 B, one request; chat boot 1,417,944 → 1,417,918 B; New Session 954,369 → 954,360 B. Strict parent comparison passes. Absolute startup is still 108 B above the current 316,272 B cap; it was already 151 B above on the landing parent. This merge adds no startup growth.All three follow-ups are merged: #180964 (
60c9291360c9), #180965 (7da1aa2fcea5), and #180967 (97be272075c7). The catalog replacement run39854680970is green. The previous head failed only two new Promise-executor lint errors; the replacement corrects those without changing production or paired-measurement inputs.