Skip to content

perf(ui): retain prepared model catalogs across warm updates - #180967

Merged
steipete merged 4 commits into
mainfrom
solid2/w-perf-model-catalog
Oct 22, 2026
Merged

steipete merged 4 commits into
mainfrom
solid2/w-perf-model-catalog

Conversation

@steipete

@steipete steipete commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

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.

Viewport / step / metric Base Candidate
desktop / session-switch / scriptMs 111.20 / 113.81 / 106.87–113.81 97.20 / 100.92 / 93.25–100.92
desktop / session-switch / taskMs 204.00 / 213.05 / 197.85–213.05 192.73 / 195.37 / 189.20–195.37
desktop / session-switch / layoutMs 3.82 / 4.00 / 3.60–4.00 3.88 / 4.08 / 3.71–4.08
desktop / session-switch / styleMs 43.73 / 47.60 / 42.22–47.60 45.64 / 47.34 / 44.17–47.34
desktop / session-switch / wallMs 342.65 / 462.02 / 326.89–462.02 344.31 / 377.27 / 326.74–377.27
mobile / session-switch / scriptMs 163.50 / 170.57 / 147.93–170.57 136.95 / 140.41 / 130.41–140.41
mobile / session-switch / taskMs 316.51 / 340.18 / 293.44–340.18 288.71 / 300.73 / 274.43–300.73
mobile / session-switch / layoutMs 1.32 / 1.40 / 1.25–1.40 1.31 / 1.39 / 1.25–1.39
mobile / session-switch / styleMs 74.22 / 78.33 / 71.62–78.33 72.99 / 75.95 / 70.16–75.95
mobile / session-switch / wallMs 811.54 / 861.29 / 792.74–861.29 809.95 / 814.85 / 775.35–814.85
desktop / sidebar-toggle / scriptMs 207.58 / 228.70 / 192.77–228.70 175.95 / 179.11 / 153.32–179.11
desktop / sidebar-toggle / taskMs 478.49 / 538.12 / 446.86–538.12 448.27 / 457.47 / 417.24–457.47
desktop / sidebar-toggle / layoutMs 19.18 / 22.51 / 18.24–22.51 19.91 / 20.95 / 19.07–20.95
desktop / sidebar-toggle / styleMs 178.09 / 210.31 / 169.95–210.31 184.81 / 186.69 / 176.81–186.69
desktop / sidebar-toggle / wallMs 517.48 / 956.56 / 494.76–956.56 488.23 / 497.26 / 452.37–497.26
mobile / sidebar-toggle / scriptMs 26.89 / 28.15 / 25.08–28.15 24.66 / 26.55 / 22.48–26.55
mobile / sidebar-toggle / taskMs 80.35 / 84.44 / 75.05–84.44 78.50 / 81.94 / 74.11–81.94
mobile / sidebar-toggle / layoutMs 0.00 / 0.00 / 0.00–0.00 0.00 / 0.00 / 0.00–0.00
mobile / sidebar-toggle / styleMs 28.26 / 30.11 / 26.80–30.11 28.87 / 29.98 / 27.76–29.98
mobile / sidebar-toggle / wallMs 277.70 / 320.28 / 277.15–320.28 277.15 / 278.98 / 270.50–278.98

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.

Check Result
Changed model-preferences unit file 9/9 passed
UI types and changed-file lint/format Pass
Independent Codex review, P0–P2 No actionable findings, including the final parameter simplification
Production base/head build and strict asset check Pass
Startup JS gzip / requests 316,030 → 316,025 B; 7 → 7
Startup CSS gzip / requests 41,141 → 41,141 B; 1 → 1
Chat boot JS gzip 1,422,063 → 1,422,074 B (+11 B)
New Session JS gzip 963,275 → 963,315 B (+40 B)
Broad browser coverage ci:full; no local E2E suite

All 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 --trace for source-mapped diagnostics. Strict asset comparison uses scripts/check-control-ui-performance.mts --dist <head> --base-dist <base> after pnpm ui:build for 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-return errors 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.

Step Busy D/M Script D/M Layout D/M Style D/M Long tasks D/M
sidebar-toggle 442.3 / 99.7 305.1 / 43.6 140.7 / 0.0 89.4 / 31.0 0 / 0
model-picker-open-search 303.2 / 326.6 134.1 / 144.0 26.0 / 27.4 108.0 / 124.6 2 / 2
cron-search-typing 303.3 / 271.3 97.8 / 90.3 22.4 / 28.4 24.6 / 19.9 1 / 0
cron-search-typing-pending 302.6 / 239.7 89.4 / 79.6 24.0 / 25.3 1.0 / 0.9 0 / 0
session-switch 196.8 / 302.3 139.6 / 177.0 27.8 / 1.6 27.1 / 78.9 0 / 0
settings-sections 147.5 / 240.4 49.9 / 71.2 4.7 / 11.9 38.9 / 73.4 0 / 0
session-palette-filter 175.3 / 156.6 104.9 / 100.5 17.4 / 15.6 16.3 / 13.0 0 / 0
cron-menu-open 150.8 / 116.3 27.5 / 21.8 16.5 / 12.2 11.8 / 9.0 0 / 0
settings-open 116.7 / 117.3 55.3 / 68.7 6.9 / 5.9 24.1 / 37.3 1 / 1
transcript-scroll-top 98.6 / 90.2 30.9 / 30.5 0.8 / 0.6 6.4 / 9.9 1 / 1
cron-open 92.3 / 97.1 44.3 / 47.2 4.3 / 5.8 15.9 / 22.5 0 / 0
cron-search 78.5 / 64.1 31.1 / 23.5 5.2 / 2.6 2.6 / 1.1 0 / 0
sessions-search 62.2 / 53.6 16.8 / 16.0 9.4 / 7.6 7.9 / 8.2 0 / 0
sessions-sort 54.2 / 46.9 21.1 / 16.9 3.8 / 3.7 9.9 / 9.5 0 / 0
sessions-open 42.8 / 50.5 25.7 / 26.7 2.3 / 2.5 8.6 / 12.1 0 / 0

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 run 39854680970 is green. The previous head failed only two new Promise-executor lint errors; the replacement corrects those without changing production or paired-measurement inputs.

@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 22, 2026
@clawsweeper

clawsweeper Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-22T20:46:09.543915Z 82b784b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@steipete

Copy link
Copy Markdown
Contributor Author

Synthetic before/after session-switch proof, desktop first and then mobile. The selected session and model remain correct; the PR body records paired timings and background requests.

desktop-session-switch-1-0

desktop-session-switch-1-1

mobile-session-switch-1-0

mobile-session-switch-1-1

@steipete
steipete enabled auto-merge (squash) October 22, 2026 20:48
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 22, 2026
@clawsweeper

clawsweeper Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR retains catalog-derived model indexes and options across unrelated Control UI updates.

Example: Mobile session switching with a 1,000-model catalog.

  • Before: Reported median scripting time was 163.50 ms.
  • After: Reported median scripting time is 136.95 ms, with selection preserved.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Strong scoped performance evidence supports the production change, but an introduced lint failure prevents a clean review.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Supplied production-bundle Chromium runs exercise warm session switching and sidebar toggling with synthetic Gateway data and a 1,000-model catalog on desktop and mobile; paired results report reduced scripting work, and inspected screenshots preserve the rendered state.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Large model catalogs add avoidable scripting work when users switch sessions or toggle the sidebar.
Reason: The maintainer-authored direction is established, and paired measurements show reduced scripting work without changing selection behavior or adding configuration.

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
Reviewed head: 82b784b2e3545ef570c5aa0de5e249829c1312c8

Before merge

  • Keep the expanded browser suite within its enforced line limit (P2) - Adding this sidebar probe pushes the file to 1,033 counted lines, exceeding the 1,000-line test limit in .oxlintrc.json. The exact-head check-lint-core-2 job reports this failure; the base file has only 1,000 total lines, so this particular error is introduced by the PR. Move the large-catalog scenario into a focused E2E file using the existing suite factory, preserving its assertions without raising or suppressing the limit.

Findings

  • [P2] Keep the expanded browser suite within its enforced line limit — ui/src/e2e/chat-model-controls.e2e.test.ts:223-228
Agent review details

How this fits together

Gateway 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]
Loading

Technical review

Best 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:

  • [P2] Keep the expanded browser suite within its enforced line limit — ui/src/e2e/chat-model-controls.e2e.test.ts:223-228
    Adding this sidebar probe pushes the file to 1,033 counted lines, exceeding the 1,000-line test limit in .oxlintrc.json. The exact-head check-lint-core-2 job reports this failure; the base file has only 1,000 total lines, so this particular error is introduced by the PR. Move the large-catalog scenario into a focused E2E file using the existing suite factory, preserving its assertions without raising or suppressing the limit.
    Confidence: 1

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 60c9291360c9.

Provenance checked

  • Composer catalog preparation keeps the original intent (07384e0: The Solid composer migration preserved existing controls and kept authoritative state in plain TypeScript owners.)
  • Picker availability and display inventory keeps the original intent (cf8b58c: Consolidate picker projection while preserving aliases, unavailable models, labels, defaults, and selection contracts.)
  • Large-catalog browser coverage keeps the original intent (b9f1e86: Protect usable model selection and typing with large catalogs while measuring production-renderer work.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • node scripts/run-oxlint.mjs ui/src/e2e/chat-model-controls.e2e.test.ts ui/src/e2e/chat-model-catalog.e2e.test.ts
  • pnpm test:ui:e2e ui/src/e2e/chat-model-controls.e2e.test.ts ui/src/e2e/chat-model-catalog.e2e.test.ts
  • git diff --check

What I checked:

PR surface

Source +12, Tests +85. Total +97 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 27 15 +12
Tests 2 86 1 +85
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 113 16 +97

Labels

Label changes:

  • add P2: This is a useful, bounded performance improvement for large model catalogs with a focused validation repair.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: This is a useful, bounded performance improvement for large model catalogs with a focused validation repair.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 22, 2026, 5:01 PM ET / 21:01 UTC.

@steipete
steipete disabled auto-merge October 22, 2026 21:06
@steipete
steipete merged commit 97be272 into main Oct 22, 2026
94 of 96 checks passed
@steipete
steipete deleted the solid2/w-perf-model-catalog branch October 22, 2026 21:32
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with prior CI and scoped validation.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 23, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui ci:full Keep ordinary native-locale CI selection on the next PR run. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant