Repository navigation
perf(control-ui): reduce sidebar work during live session updates - #176453
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 unchanged sidebar row formatting during live updates and repairs the cold-load benchmark readiness checks. Example: A 300-session dashboard receives 240 live events.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-directed optimization has measured value, preserves the existing projection ownership, and introduces no actionable defect found in this review. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherGateway session publications enter the Control UI session owners; sidebar navigation formats their rows before the existing tree and section projections produce visible navigation. flowchart LR
A[Gateway session events] --> B[Session publication owners]
B --> C[Sidebar navigation]
C --> D[Row formatting cache]
D --> E[Tree and section projection]
E --> F[Visible sidebar]
Technical reviewBest possible solution: Retain this focused row-lifetime cache while preserving authoritative publications and the existing tree projection. Do we have a high-confidence way to reproduce the issue? The base formats every row again after a session publication; the committed mounted-sidebar regression and reported red-before/green-after result isolate unchanged-row work. Is this the best way to solve the issue? The change is appropriately scoped: reuse formatting at its existing owner, retain broad upstream invalidation, and leave membership, nesting, expansion, and Home decisions with their current owners. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f93eea455c72. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +65, Tests +41, Docs +4, Other +11. Total +121 across 13 files. Added test files: 0. View PR surface stats
Review metrics
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 HistoryReview history (1 earlier review cycle)
Reviewed October 18, 2026, 9:35 PM ET / October 19, 2026, 01:35 UTC (Revision 2). |
1e888ee to
a8fd350
Compare
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. |
827223d to
89bd9b9
Compare
Reuse formatted rows across immutable session publications while preserving live context, attention, run-state, and child-loading invalidation. Keep membership and tree projection with their existing owner.
…ness Keep the memo primitives outside the sidebar projection pipeline to remove the import cycle. Wait for the shared chat header in the Team-scale rig so both chip and roster modes reach their existing content assertions.
Preserve assertions for owner attribution, group membership, and pinned dashboard navigation while replacing rows whose published facts change. Reuse the rail fixture's existing publisher.
89bd9b9 to
ea2306b
Compare
|
@clawsweeper re-review Final head: ea2306b. The PR body now includes the eleven performance pairs, final-head tests, full UI e2e results with successful setup-corrected focused replays, and inherited CI failure evidence from main. No source changes followed the clean P2 review. |
|
🦞👀 Re-review progress:
|
…ve events (openclaw#176453) Every live session event rebuilt sidebar row presentations for the whole roster: under a Team-scale 240-event replay, projectSidebarAgentSessionRows was ~12.9% of sampled CPU (602 ms inclusive per replay in the earlier attribution), shared by visibleSessionRowsInOrder, synchronizePresentedSessions, childSessionParents and selectedAgentSessionRows. Row formatting now belongs to the row's lifetime: a per-row memo (separately for root and child placement) reuses the previous presentation when the row object and every external input it reads (context, default agent, self user, locale, active/visually-active state, run state, work-session, PR summary, outbox count, draft flag, attention resolver, agent status note, child loading) are unchanged. Owners publish replacement rows and new identities when facts change. The bench's live-replay readiness assertion is updated for the current header. Eleven interleaved AWS c7a.4xlarge pairs, live-event replay: scripting per event 11.338 -> 10.559 ms (-6.87%, 11/11 pairs, non-overlapping IQR); live scripting 2,721 -> 2,534 ms per 240 events. A separate reload-only check (11 pairs per route): board blocking 189 -> 210 ms (8/11 worse, overlapping IQR), warm chat 237 -> 225 ms; the reload-window profile shows the new slot owner at 0-1.4 ms and row-owner self time flat (board) or lower (chat). Runtime +65 LOC. 203 focused tests and full UI e2e (830 files / 3,591 tests) pass; the remaining CI red is the inherited chat boot JS bundle cap.
What Problem This Solves
Reduces sidebar work while live session events arrive after a signed-in dashboard deep-link reload. The campaign's original reload trace had 14 visible states over roughly 15 seconds; this lane addresses the shared sidebar projection hot path and repairs the stale benchmark readiness selector so the replay actually runs on the current UI.
User Impact
The sidebar keeps its existing grouping, nesting, expansion, Home, pinning, and snooze behavior while spending less main-thread time on unchanged rows. No configuration, server schema, or durable stored-shape changes.
Why This Change Was Made
The four consumers already share navigation, row, section, and Home memos. A session publication invalidates navigation and repeats formatting for every row even when most raw row identities are unchanged. A sidebar-owned WeakMap now retains that formatting, with separate root/child slots and explicit inputs for context, default agent, viewer, locale, selection, visual run state, prepared work, PRs, outbox/drafts, attention, status notes, and child loading. Membership, parentage, active-parent folding, expansion, and Home visibility remain with the existing tree owner.
The former standalone runtime timestamp map moves into this row-lifetime owner. Memo primitives live in a leaf module so navigation never imports the projection pipeline to obtain its cache type. The change deliberately retains broad session revision invalidation: dropping it would miss external prepared-work, PR, and lifecycle facts.
Evidence
Eleven interleaved baseline/candidate pairs on one quiet AWS
c7a.4xlargelease (observed 16 vCPU AMD EPYC 9R14), using the Team-scale fixture and repository Chromium. Each unprofiled run delivered all 240 live events. Baseline/candidate order alternated per pair; both used immutable production bundles on base944eba49f398480d2776f3698a7605f719dcc6bf. The projection patch rebased without conflicts; final-head functional validation is listed below.Primary gate passes: 6.87% less scripting/event, non-overlapping IQRs, better in 11/11 pairs, median paired delta −0.827 ms/event. Reload blocking has a higher candidate median, overlapping IQRs, and mixed pair signs (7 worse, 4 better), so it does not meet the campaign's secondary regression threshold of non-overlapping IQRs or ≥9/11 worse pairs plus the magnitude threshold. Live RPCs were zero throughout; reload RPC counts had median 86 in both variants (range 56–86).
Separate sampled CPU profiles reproduce the live hot path: the baseline spends 571.4 ms, or 12.9% of aggregated samples, in projectSidebarAgentSessionRows before measuring the fix. These timings are inflated by profiling and are attribution evidence, not acceptance measurements. The candidate used
--cpu-profile-compare.AWS lease
cbx_a729a7ce7686: baseline profile, candidate profile, 11 pairs.Behavior and checks
pnpm test <file> --maxWorkers=1wall times on AWS: 9.01 s, 4.21 s, 3.73 s, 3.94 s, 16.34 s, 7.49 s respectively. The added memo regression failed on old behavior in 18.98 s.cbx_35da83a727b3: run. Madge: zero cycles. Team-scale e2e: pass, including paged roster, pins, plugins, inline widgets, cache restoration, and reload (52.09 s runner duration). The readiness check now uses the header common to chip and roster modes; agent-named headers only exist in roster mode.ea2306bf4a91440291c3b10e1e381087595f6686. Four existing test fixtures now publish replacement rows for edited facts, preserving all assertions and unchanged row identities. They pass in the final-head focused run. This test-only repair is clean through P2.cbx_569628be8acf, run: 827 files passed, 3 failed, 3 skipped; 3,586 tests passed, 1 failed, 7 skipped, in 6,033.62 s. The failures are setup-related: Workboard native bundle and tooltip activation need WebKit, and the automation-management fixture rejects a group-writable artifact ancestor. Setup-corrected focused replays now pass: Workboard + tooltip in Chromium/WebKit, 4 tests, and automation management, 2 tests. WebKit was installed and the automation artifact directory stayed inside the checkout under non-writable ancestors. The first automation replay reached cleanup but used an artifact path outside the checkout; its corrected replay passes. Combined coverage: 830 files / 3,591 tests passed, 3 files / 3 tests skipped, no unresolved e2e failures. This is a full invocation plus focused setup repairs, not a second all-green full invocation.chat-steer-deferred-custody.real-gateway,deepseek-search.real-gateway, anddesktop-resize.real-gateway(one test each).node scripts/check-changed.mjscompleted: all core-test, UI, and script typechecks, changed-file lint/format, i18n, controller, and SQLite guards pass. Overall result is red on repository-wide findings outside this diff: three unlisted max-lines suppressions,plugins-platformwith 723 test roots against 720, and the existing unused-export list. All 41 reported files/configuration owners inspected are byte-identical to the PR base; the script unused-export scan passes. No exception or baseline was changed.Reload-only follow-up (coordinator gate)
Both routes pass the fixed reload-blocking gate. Board has a higher candidate median and is worse in 8/11 pairs; its IQRs overlap by only 0.5 ms. Warm chat improves at the median and is worse in 5/11 pairs. Neither route has non-overlapping worse blocking IQRs or ≥9/11 worse pairs. This is acceptance under that fixed rule, not a claim that board reload improved.
One fresh quiet AWS
c7a.4xlargelease,cbx_0df288ff9a14(observed 16 vCPU AMD EPYC 9R14, about 31 GiB RAM); completed run. Eleven interleaved pairs per route, variant order alternated per pair, route order alternated across pairs. One immutable baseline bundle and one candidate bundle were built before timing. Both use base4392036843f6cc6f53df2d1a0aaa64afb030c87cwith the same faithful fixture/harness; only the sidebar runtime change differs. Candidate runtime is the published headea2306bf4a91440291c3b10e1e381087595f6686. No live replay or active-run churn is enabled; every measured reload delivered the normal 18 boot events and restored the same 80-message bounded snapshot from the 240-message fixture. Repository Chromium, 1719×1179, 35 ms inbound latency / 4 ms minimum wire spacing. Lifecycle wrappers and timeline tracing are disabled for all timing runs; the canonical LoAF/mutation and RPC probes remain enabled. The temporary benchmark copy changes only route selection, dashboard-specific readiness, wrapper settings, and provenance. Screenshots confirm the board and chat routes render their distinct intended layouts. The temporary harness is retained with the local report; no tracked benchmark or production edit was needed.FCP is reported separately from the fixed blocking gate. Warm-chat FCP has a +140 ms difference of medians and a +8 ms median paired delta, with wide overlapping IQRs and 8/11 worse pairs. Board FCP has one tied pair. The full distributions are retained rather than reduced to a no-regression claim.
Separate reload-only
--cpu-profile-comparecaptures use three profiled reloads per variant per route on the same lease. These timings include profiler overhead and are attribution, not acceptance measurements. No live phase exists in these profiles. Moved functions are matched by source owner/name so the memo extraction does not count as new work. Inclusive functions nest and must not be summed.The candidate slot-owner self samples are board
[0, 1.061, 0]ms and chat[0, 0.388, 1.387]ms. A zero sample means below resolution, not zero allocation cost. The slot-owner inclusive medians are 4.576 ms on board and 3.929 ms on chat, including work it calls. The row owner adds about 0.27 ms self at the board median and falls about 5.54 ms on chat; these captures do not attribute the board’s +21 ms blocking median to slot construction. No lazy-build change was attempted because both routes passed the fixed gate.RPC counts vary across runs: board request medians are 83/83 and chat 57/57; per-pair RPC median delta is zero for both. All 44 timing runs have no live replay and pass route/content readiness. Host load before each run was 1.05–2.98 on 16 vCPU. The initial temporary-harness attempt completed the baseline profile but failed writing summary metadata; it produced no accepted timing pairs and was rerun into a fresh directory.
The published source remains unchanged; CI run
39172147593is on this exact head. Its only substantive red remains the inherited chat boot-size limit (base 1,490,230 B > 1,490,000 B; candidate 1,490,435 B), as documented above. The PR stays ready; lead owns merge. The measurement lease is released after artifact collection.Size and ownership
Application runtime delta: +65 LOC. The explicit dynamic-input contract and retained root/child slots require growth; the old timestamp map/plumbing is replaced. Benchmark instrumentation/readiness adds +11 LOC, benchmark documentation +4: +105 with the campaign's exact filter, which also includes +25 lines of test-fixture helpers. Application runtime remains +65. No second tree owner or Solid store rewrite. All AWS leases used for measurement and validation have been released.
Synthetic before/after
Captured from the synthetic Team-scale fixture during replay. The transcript position differs with capture timing; sidebar layout and behavior are unchanged. No private Team capture is included.
Before:
After: