Repository navigation
perf(ui): reduce model picker navigation work - #182249
Conversation
Preserve per-row search and window metadata, suppress unchanged ranked results, and defer provider cost scans until the usage popover is read. Keep keyboard, shortcut, and grouped ARIA behavior intact.
|
🦞👀 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 maintainer review before merge. What this changesThis PR preserves per-row picker metadata, defers closed usage-popover cost reads, and adds optional CPU-clock benchmark measurements. Example: Navigate 20 arrow-key steps through a 1,000-model catalog.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR removes demonstrated redundant UI work, and source review found no actionable introduced defect. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Control UI derives searchable model, target, and account rows from its existing catalog owners, then presents them through one virtual window; the composer separately derives usage details from session messages. flowchart TD
A[Catalog owners] --> B[Search and disclosure]
B --> C[Per-row projections]
C --> D[Virtual picker window]
D --> E[Keyboard and pointer selection]
F[Session messages] --> G[Lazy usage details]
Technical reviewBest possible solution: Retain the existing picker and overlay owners while deriving stable per-key metadata and reading provider costs only when observed. Do we have a high-confidence way to reproduce the issue? Current-main source rebuilds aggregate metadata Maps and eagerly evaluates provider costs; the submitted work-count regressions and browser measurements corroborate those paths, without a local execution during this review. Is this the best way to solve the issue? The patch is a small, coherent change: equivalent ranked results stop downstream publication, readonly projections preserve unchanged fields, and the existing cost memo becomes lazy without adding another owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4dc5be9f0282. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +4, Tests +134, Other +57. Total +195 across 8 files. Added test files: 1. 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 24, 2026, 1:42 AM ET / 05:42 UTC. |
|
Merged via squash auto-merge.
|
* perf(ui): keep model picker derivations local Preserve per-row search and window metadata, suppress unchanged ranked results, and defer provider cost scans until the usage popover is read. Keep keyboard, shortcut, and grouped ARIA behavior intact. * perf(ui): measure renderer thread CPU in benchmarks
What Problem This Solves
The model picker publishes new aggregate Maps even when ranked rows or virtual-row geometry are unchanged. The retained, closed context-usage popover also eagerly reads message costs.
Use per-key Solid projections for search metadata and virtual rows, compare immutable ranked rows before publishing equivalent results, and make provider costs lazy. Search ordering, grouped ARIA positions, digit shortcuts, disclosure, focus, and usage details retain their behavior. Domain owners and lazy imports are unchanged. The benchmark harness gains an opt-in
--thread-cpu-timemode; its default clock is unchanged.Evidence
A true result change still invalidates affected ranks. Usage lifecycle coverage proves current costs on reopening and no cost reads after closing. Text-only streaming deltas already bypass the composer snapshot; this does not remove a cost scan per token. The counters exercise production derivations at the unit boundary, not whole-application instrumentation.
CPU qualification
CPU changes below are median / p95; negative means less CPU time.
Absolute CPU measurements (ms, median / p95)
Twenty interleaved pairs per candidate cell and A/A cell use byte-identical baseline copies, the production renderer, synthetic Gateway, 1,000 models / 400 messages, desktop 1440×1000, Chromium 156.0.8078.4, and a 32-CPU darwin-arm64 host.
Performance.enable({ timeDomain: "threadTicks" })selects renderer-thread CPU time for script/task metrics. Wall/frame values remain diagnostic and do not decide acceptance under the coordinator direction below.The four CPU cells above qualify within the 5% band or better. The original 20-key navigation A/A control remained unqualified after its predeclared ten-pair extension: combined 30-pair script/task medians -0.12%/+1.73%, p95 +8.91%/+7.85%. Its roughly 18 ms scripting window was too variable for qualification. Those results remain diagnostic, not passing. The separate longer navigation cell repeats the same checked 20-key cycle five times, using the same production bundles and existing harness; its 20 A/B and combined 30 A/A pairs are reported above. The longer A/A cell initially had task p95 +5.17%, so it also received one predeclared ten-pair extension. No samples were discarded.
Host one-minute load averages: Open/search candidate: 32.9 median (28.6–35.4); Open/search control: 35.5 median (33.1–45.2); Already-open search candidate: 38.1 median (33.5–44.3); Already-open search control: 42.0 median (35.2–46.3); Keyboard navigation, 100 keys candidate: 44.1 median (39.7–48.1); Keyboard navigation, 100 keys control: 34.9 median (21.9–40.7); Streaming candidate: 27.6 median (19.1–44.0); Streaming control: 17.4 median (11.6–30.9).
Keyboard navigation improves; open/search and streaming are effectively flat. The goal of meaningful script-time reductions in three scenarios remains unmet. No streaming speedup is claimed. This is synthetic renderer/mock-Gateway proof, not a live provider/Gateway run.
The earlier wall-clock evidence is retained as a measurement limitation: candidate open/search automation p95 was +17.9%, and streaming input-to-frame median +9.2%. An identical-build A/A control also moved input-delay p95 by +21.7% and input-to-frame p95 by +18.2%. Those measurements could not distinguish code effects from loaded-host/frame scheduling noise. The CPU comparison above implements the explicit acceptance decision; it does not relabel the earlier results as passing.
Coordinator acceptance decision
Both Testbox requests queued without producing samples and were stopped; cleanup is reconciled with cancelled runs 40065566007 and 40065688287. No active lease remains.
Checks and review
One production build per side and the strict performance comparison passed. The three focused test files ran once with
--maxWorkers=1and the pinned Bun runtime. UI/script typechecks, scoped lint/format, andgit diff --checkpassed. Independent isolated production and harness autoreviews found no actionable P0–P2 defects.ci:fullselects every UI unit, Control UI E2E, browser-extension, and real-Gateway shard.The production Knip command reports
src/gateway/assistant-human-mentions.tsunused on both the exact merge base and head; base also reports unusedeslintin the lint workspace. The exact-base run borrowed identical-lockfile dependencies through symlinks. No new ignore or export allowance is added.The paired CPU/build measurements and 23 focused tests above were collected at
9e0091ffcc0d07a66ac565d4568e7df009ad66dfagainst2ecd64669e19ab41606c1fd1444862a63dee7863. The later conflict-free merge commit2451fd923ecd0a2d6692205812b42a6765272e1eintegrates main5d47168b9170d92c45aeb82cd7680719f211b89a; the three production UI modules are byte-identical to the qualified head. Fresh UI/script typechecks and another independent P0–P2 review pass after integration. Final-head Knip still reports only the same inherited unused file.The original full CI run 40066014710 and
openclaw/ci-gatepassed. Native admission later stopped before dispatch because the separate Rust workflow failed the baseline-reproducednative_signed_connect_preserves_product_fields_and_rejects_invalid_node_manifestsClippy limit (111/100 lines), and my shortened PR body had dropped the checker's two required section headings. The headings are restored and pass the local policy check. Main's #182269 fixes the Rust failure and is included by the merge; exact-head full CI 40071019913 passed with no failed or pending jobs. The PR merged as3484041380f3621eaf1a3974eea6551e35e6df7d, verified onorigin/main. No auto-merge request was retained from the stopped attempt.The Solid refactor checklist has zero effects, render effects, untrack, direct listeners, DOM queries, flush, or owner API calls in all three production modules before and after. Memos 11 → 8; projections 0 → 2; lazy memos 0 → 1. The four production lines buy per-field identity preservation and explicit equality/lazy contracts. No new abstraction or owner is introduced.
Reproduction commands
The 100-key navigation cell uses a task-local driver around the existing scenario; each original cycle preserves its assertions:
Visual proof
Inspected synthetic before/after screenshots are pixel-identical.