Skip to content

perf(ui): retain agent selector rows and retire selection routes - #185990

Merged
steipete merged 13 commits into
mainfrom
solid2/w-perf-agent-reopen-round2
Oct 27, 2026
Merged

steipete merged 13 commits into
mainfrom
solid2/w-perf-agent-reopen-round2

Conversation

@steipete

@steipete steipete commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Selecting an agent in a 300-agent roster retained each menu button but rebuilt all 300 inner avatars and labels. Selection-specific route receipts also stayed cached for 30 minutes despite never being reused.

Retain the menu content and avatar descriptors by agent key, reconcile checked metadata by ID, and memoize the missing-selection fallback. Retire obsolete Agents route receipts immediately while preserving the module and roster caches. Menu continues to own keyboard, pointer, focus and ARIA behavior; the avatar loader retains resource ownership.

The warm-selection workload shows a real CPU reduction at both CPU rates. It still misses the campaign task-time targets (100 ms at 1×, 200 ms at 4×). The separate retention validator remains red; this PR does not claim bounded memory.

Proof

Check Result
UI typecheck Passed
Direct UI tests 26 passed once: 13 AgentSelect and 13 route tests; unchanged production source reused
CI test repair Exact group-preview case passed once on 29348382adaa; 8 other cases excluded; UI types and scoped formatting passed
Route receipt regression on base Red: one retired cached route, expected zero
Format, lint, diff and normal commit hooks Passed
Independent source reviews No actionable findings; prior full-diff review plus reviewed follow-ups reused unchanged; test-only layout repair received a full-context independent P0–P2 review
Production build + strict performance Passed on merged head 9d1a13732ff8 vs base e4749abd4ec; zero warnings or violations
Startup gzip, same-host current base → merged head 90,245 → 90,246 B (+1 B); JS requests 3→3; CSS requests 1→1
Route boot gzip Chat 1,269,895→1,269,866 B (−29); New Session 771,461→771,588 B (+127), within cap
Timing qualification 20 serial A/H/C triples per CPU rate; all 120 observations passed; complete renderer intervals
Structural behavior All 300 outer rows retained; H retains all 300 inner avatars, A/C retain zero; zero warm identity RPCs
Production Knip Passed on 9d1a13732ff8
Merged-source checks Frozen install, UI and tooling types, scoped format/lint, normal merge hooks passed
Broad CI Completed exact-head ci:full run 40532099102: three baseline-reproduced E2E failures plus their aggregate gate; all other jobs, including both real-Gateway shards, passed

A/C are the same frozen original 154e39f03a2d bundle; H is the frozen pre-integration ed1160360aa head. These 120 observations were collected before merging current main and are retained as that exact-head evidence, not relabeled as a new merged-head run. Cells below are median / p95 / min–max, in milliseconds. P95 uses the same nearest-rank calculation as the harness. Wall is automation-to-assertion, not INP. Script/task use thread CPU time; renderer CPU spans the full renderer process interval. Runs were headless and untraced.

1x timing and A/A control
Metric A (base) H (head) C (base control) H/A median C/A median
wallMs 465.28 / 543.76 / 428.66–543.89 350.12 / 386.20 / 330.66–396.28 500.52 / 548.22 / 428.06–573.98 -24.75% +7.57%
scriptMs 170.12 / 175.69 / 156.99–194.42 98.23 / 104.44 / 95.32–104.89 169.87 / 177.57 / 160.92–179.06 -42.26% -0.14%
taskMs 312.40 / 379.69 / 293.91–388.19 213.24 / 222.73 / 202.54–230.47 368.59 / 380.37 / 299.36–403.82 -31.74% +17.99%
rendererCpuMs 481.68 / 644.17 / 444.12–694.14 311.95 / 335.45 / 297.00–345.87 555.29 / 623.93 / 450.82–674.14 -35.24% +15.28%
layoutMs 39.39 / 51.02 / 37.10–51.96 24.01 / 26.16 / 22.13–26.25 49.28 / 58.12 / 37.78–59.19 -39.05% +25.11%
styleMs 46.91 / 57.36 / 44.90–57.45 30.71 / 31.65 / 29.83–31.66 56.33 / 62.92 / 44.47–65.16 -34.52% +20.08%
longTasks.count 1.00 / 1.00 / 1.00–1.00 1.00 / 1.00 / 1.00–1.00 1.00 / 1.00 / 1.00–1.00 +0.00% +0.00%
longTasks.totalMs 116.00 / 125.00 / 108.00–127.00 59.00 / 66.00 / 54.00–67.00 116.00 / 122.00 / 106.00–122.00 -49.14% +0.00%
longTasks.maxMs 116.00 / 125.00 / 108.00–127.00 59.00 / 66.00 / 54.00–67.00 116.00 / 122.00 / 106.00–122.00 -49.14% +0.00%

One-minute host load ranges: A 20.83–26.50, H 21.50–26.46, C 20.83–26.50.

4x timing and A/A control
Metric A (base) H (head) C (base control) H/A median C/A median
wallMs 1838.51 / 2019.39 / 1565.20–2080.27 1199.80 / 1389.35 / 1143.47–1411.50 1888.82 / 2006.89 / 1685.01–2022.52 -34.74% +2.74%
scriptMs 1007.65 / 1127.75 / 778.41–1168.52 570.24 / 633.60 / 520.82–638.83 1000.47 / 1109.26 / 839.32–1118.90 -43.41% -0.71%
taskMs 1765.84 / 1958.04 / 1500.23–1982.59 1129.41 / 1257.09 / 1035.15–1308.89 1805.81 / 1892.88 / 1605.24–1911.97 -36.04% +2.26%
rendererCpuMs 2163.17 / 2423.37 / 1917.83–2476.83 1407.90 / 1657.12 / 1312.25–1748.19 2213.86 / 2414.63 / 2073.00–2554.73 -34.92% +2.34%
layoutMs 187.96 / 219.52 / 135.91–235.03 113.29 / 129.49 / 104.17–143.41 183.37 / 208.37 / 141.33–212.84 -39.72% -2.44%
styleMs 218.87 / 237.45 / 173.58–245.32 159.22 / 174.10 / 144.48–186.30 223.85 / 234.39 / 188.32–244.19 -27.26% +2.27%
longTasks.count 7.00 / 7.00 / 5.00–7.00 7.00 / 7.00 / 5.00–7.00 7.00 / 7.00 / 6.00–7.00 +0.00% +0.00%
longTasks.totalMs 1453.50 / 1631.00 / 1148.00–1645.00 844.50 / 969.00 / 667.00–993.00 1490.00 / 1567.00 / 1246.00–1573.00 -41.90% +2.51%
longTasks.maxMs 665.50 / 748.00 / 554.00–761.00 357.50 / 420.00 / 319.00–434.00 683.00 / 744.00 / 584.00–755.00 -46.28% +2.63%

One-minute host load ranges: A 22.85–38.90, H 22.46–39.49, C 22.40–39.49.

At 1×, A/A task, renderer, layout/style and wall medians are outside the timing band. The script control median is −0.14% and p95 +1.07%, versus H script median −42.26% and p95 −40.55%; the CPU reduction and retained-row counters support the win despite noisy aggregate timing. At 4×, A/A task/renderer/script medians are +2.26%/+2.34%/−0.71%, with lower p95s. H task median/p95 improve 36.04%/35.80%, and script improves 43.41%/43.82%.

The test selects agent 0299 from an already hydrated roster and settles the resulting route. It does not establish cold hydration, first reopen, roster replacement, whole-page disposal or network-latency performance. Every measured action makes zero identity requests; setting an identity delay would not turn it into an RTT measurement.

Retention result and limits

Ten cycles of four actual selections return to main before forced-GC snapshots. The candidate holds one active Agents receipt before/after, replacing the old growth from five to 45 receipts (four to 44 cached entries). Live/disposed Solid owners, candidate DOM/detached nodes and listener counters remain flat in this finite test.

The unchanged validator fails because active timeouts grow A/H/C +41/+1/+41. The remaining single timeout is not attributed. Candidate forced-GC heap grows 1,372,604 B, versus 1,290,500/1,223,672 B for A/C. A separate snapshot attribution finds 82.4% of summed self-size growth among the largest groups in V8 code/bytecode/feedback/deoptimization metadata. A projection WeakMap's allocated table grows while its observed target edges stay at 1,200. This is finite evidence, not an unlimited-duration memory bound.

The timing runs do not force GC: at 4× the H heapAfter median is +20.21% versus A, with C +71.71%. Those GC-sensitive samples do not support an all-memory improvement claim. No validator, budget or expected failure was relaxed.

Before and after

Inspected synthetic data only. Both captures show the same selected agent; the version footer is cropped. All six uncropped A/H/C qualification images were also inspected.

Before:

Before: selected synthetic Data agent 0299

After:

After: selected synthetic Data agent 0299

Scope and size

Ten changed files against merge base e4749abd4ec: 4,476→4,884 LOC (+408), including production 266→291 (+25). The final test-only repair is 2 insertions/7 deletions; production remains byte-identical to the built 9d1a13732ff8 head. The remaining growth is the focused regression/benchmark/retention proof and documentation. Simplification reused Menu's existing custom-render contract; there is no new lifecycle or focus owner. Solid census: memos 3→4, projections 0→2, onSettled 1→1; effects, render effects, component cleanup, untrack, direct listeners/DOM queries, flush and owner APIs remain zero.

Release-note context: large agent selectors retain their menu contents during selection and avoid caching obsolete selection-route receipts. Existing routes, tags, classes and selectors remain intact; no dependency or preference changes.

Main integration

A real merge conflict required merging e4749abd4ec. Both mobile drawer guards and main's plugin catalog window/scroll behavior are preserved; a focused independent review of the combined resolution found no actionable issue. The selector, route and their tests, Menu implementation and avatar renderer remain byte-identical to the measured ed116 head. Main also changes shared overlay colors, layout measurement and shell/bootstrap code, so the earlier timing distributions and screenshots stay explicitly attributed to their frozen context.

Final build comparison uses identical packaged inputs for memory-core, nostr and WhatsApp (13 manifest/package/UI files, hash-verified before and after); it does not compare inventories of different sizes. The focused lint was initially invoked with the broader scripts config and cancelled through normal cleanup after it admitted unnecessary package-boundary preparation. Its correct scoped-config replacement passed; the cancelled receipt is retained, and no passing checks were rerun.

CI attribution and test repair

Completed exact-head ci:full run 40532099102 tested merge da97507604a0, with verified ordered parents main 5e27a6cf109f and PR 29348382adaa. Reconstructing those parents produces the identical tested tree. All other jobs passed, including both real-Gateway shards. Its three failing E2E cases also fail on clean main 43dc38e6c137, the latest completed scheduled-main revision (40523031614, rechecked while newer 40532514201 remained in progress):

Exact failing test Current PR job Matching main evidence
Control UI chat send pending handoff > does not recreate a consumed prompt outside the visible history page after reconnect 122288319877 Canonical local replay on exact 43dc: same line 517, expected zero / received one
Chat startup request priority > reconciles an explicit suggestion refresh after an event while chat remains held (hidden: true) 122288319921 Same exact-main replay: same line 235, expected zero / received one
Chat header and delegated work > keeps new batches in Details and opens Subagents manually without duplicate wait status 122288320030 Separate one-case canonical replay on exact 43dc: same line 211, waiting for the 1 subagent running button; local/CI default timeouts are 10/30 seconds

The main replays use unchanged source/config/lockfile, retained logs and result JSON, with exact executed-name checks. The first invocation executed three named cases (two failures, group preview passed, 17 others excluded). The header invocation executed exactly one case and failed. No fixtures, assertions or thresholds changed. The CI summary only compared shard names and labels the header shard new; attribution here uses the exact failing test and matching actual-main replay. Failed scheduled-main log downloads returned empty files and supply no evidence.

The prior-head run also exposed a group-preview geometry readiness race. That case passed both original local baselines, so it was not classified as inherited. CI compared x=89.796875 before sending with x=411 afterward following a mobile-to-desktop viewport reset; its readiness predicate accepted both layouts. The test-only repair uses the existing waitForLayoutSettled helper, preserving viewport/theme/RTL coverage and final x/y/style assertions. The exact case passed once locally (1.36 seconds, eight excluded), after full-context independent review, UI types and scoped formatting; the current full CI has no failure for it. This is not a local red/green claim for the intermittent race.

The prior auto-merge request was explicitly retired before pushing this replacement. Fresh exact-head review and native github_pending preparation are complete. The three attributed CI failures use the documented native replacement/admin route; failed CI and the separate local retention failure remain recorded as failures. No budget or validator threshold was relaxed. Timing, build and screenshot evidence retains its original measured source attribution; the final test repair changes no production bytes.

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

clawsweeper Bot commented Oct 27, 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 27, 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-27T14:33:36.464290Z 9d1a137 New commits
ℹ️ 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.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui scripts Repository scripts size: L labels Oct 27, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 27, 2026
@steipete
steipete enabled auto-merge (squash) October 27, 2026 14:40
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 27, 2026
@clawsweeper

clawsweeper Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR retains agent-menu content across selections and immediately retires obsolete Agents route receipts.

Example: Select Data agent 0299 from a hydrated 300-agent roster.

  • Before: All 300 inner avatars and labels are rebuilt despite retained outer buttons.
  • After: All 300 inner avatars remain mounted while the selected agent and route update.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Focused, useful implementation with qualified browser evidence and no discrete introduced defect; CI is not yet clear.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The built Control UI browser workload exercises hydrated 300-agent selection, retained avatars, zero warm identity reads, and repeated route settlement; inspected before/after screenshots corroborate unchanged visible output. Measurements remain attributed to ed11603, with changed production owners verified unchanged at the reviewed head; synthetic transport establishes renderer behavior, not live Gateway latency or bounded memory.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Selecting an agent in a large roster performs avoidable work and keeps obsolete route receipts alive.
Reason: The feature owner directs a focused optimization with measured renderer savings; broader memory bounds and campaign latency targets are explicitly outside the claimed result.

Merge readiness

✅ Ready for maintainer review

Keep open: this owner-directed optimization addresses repeated renderer work still present on main. No actionable introduced defect was found; exact-head CI remains blocked.

Priority: P2
Reviewed head: 9d1a13732ff87ef8165db6760a35a2a014a01e16

Before merge

None.

Findings

None.

Agent review details

How this fits together

The shared selector consumes roster options, identity data, and the current selection, then emits a selected agent ID; the Agents route translates URL and selection intent into page data.

flowchart LR
  R[Agent roster and identities] --> S[Agent selector]
  S --> M[Menu interaction owner]
  S --> A[Avatar resource owner]
  M --> C[Settings selection owner]
  C --> L[Agents route loader]
  L --> P[Agents page]
Loading

Technical review

Best possible solution:

Retain the existing Menu and avatar owners while preserving keyed row content and retiring unused selection receipts.

Do we have a high-confidence way to reproduce the issue?

Current-main source shows selection-dependent JSX reconstruction and intent-keyed route receipts; supplied browser measurements demonstrate the resulting repeated work, but no target code was executed during this read-only review.

Is this the best way to solve the issue?

The smallest complete repair is keyed presentation retention plus route-receipt retirement using existing owners; the diff preserves current interaction, resource, roster, and selection-intent contracts.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Agent selector content and avatar descriptors keeps the original intent (ecdc40d: The Solid picker migration preserved selection, keyboard navigation, focus, existing tags, and shared Menu ownership; later avatar work preserved authenticated resource leases.)
  • Agents route receipt retention changes intended behavior with a stated reason (dd52d73: Intent revisions distinguish superseded Settings selections; this PR preserves that identity and changes receipt lifetime because old revisions are not reused.)
  • Retention collector request history keeps the original intent (7785bf0: The collector measures retired renderer state; the new opt-in preservation mode keeps benchmark request cursors valid while leaving existing callers' clearing behavior intact.)
  • Agent-selection benchmark keeps the original intent (ac3c0cb: The large-data campaign measures visible renderer work; this PR adds inner-avatar identity and separate GC diagnostics without treating diagnostic timing as performance evidence.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source +25, Tests +103, Docs +34, Other +251. Total +413 across 9 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 70 45 +25
Tests 2 106 3 +103
Docs 1 55 21 +34
Config 0 0 0 0
Generated 0 0 0 0
Other 4 308 57 +251
Total 9 539 126 +413

Review metrics

Metric Value Why it matters
Production versus regression-test growth Production +25 LOC; focused tests +103 LOC The production growth retains live keyed presentation through Menu's existing renderer contract; the tests cover row identity, roster changes, fallback retirement, and route-cache lifetime.

Labels

Label changes:

  • add P2: Measured renderer improvement for large agent rosters with limited blast radius and no established urgent regression.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Measured renderer improvement for large agent rosters with limited blast radius and no established urgent regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

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 27, 2026, 10:50 AM ET / 14:50 UTC.

@steipete
steipete disabled auto-merge October 27, 2026 15:32
@steipete
steipete merged commit ba743d5 into main Oct 27, 2026
118 of 126 checks passed
@steipete
steipete deleted the solid2/w-perf-agent-reopen-round2 branch October 27, 2026 16:12
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 28, 2026
…nclaw#185990)

* perf(ui): retain keyed agent option content

* test(ui): record retained agent avatar identities

* test(ui): qualify agent selector retention and warm identity reads

* style(ui): format agent selector performance proof

* perf(ui): retain avatar descriptors across agent selections

* test(ui): cover missing agent fallback retirement

* fix(ui): type the agent selector fallback memo

* test(ui): measure retained heap across agent selections

* perf(ui): retain agent menu rows and retire selection receipts

* test(ui): settle layout before comparing draft geometry
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: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant