Repository navigation
perf(control-ui): reconcile parked header menu rows - #174803
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 pauses closed header-menu updates and reconciles retained session and owner rows before opening. Example: A dashboard with 300 sessions and 126 owner choices receives synthetic live traffic.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this is a focused, measured performance improvement with green exact-head CI and no actionable correctness or security findings. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Control UI projects session, settings, and directory state into the shared native menu; opening refreshes presentation before validation and focus, while existing action owners handle selections. flowchart TD
A[Session and settings owners] --> C[Parked presentation]
B[Profile and agent owners] --> D[Keyed owner projection]
C --> E[Shared native menu]
D --> E
E --> F[Existing session actions]
Technical reviewBest possible solution: Retain this focused implementation, which parks presentation dependencies while preserving the existing menu and action owners. Do we have a high-confidence way to reproduce the issue? Fetched main exposes live header props and eagerly derives owner options while closed; the supplied paired browser measurements demonstrate the resulting mutations, but no target code was executed during this read-only review. Is this the best way to solve the issue? The change uses the existing parked-projection boundary and keyed derived stores, removes the eager roster memo, and preserves the native menu's synchronous opening contract without adding a scheduler. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 98f3808b30dc. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +34, Tests +65. Total +99 across 7 files. Added test files: 0. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. 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 16, 2026, 11:16 PM ET / October 17, 2026, 03:16 UTC (Revision 2). |
42bc82b to
6d6971d
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. |
553a939 to
a734600
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
a734600 to
6f4f8a5
Compare
6f4f8a5 to
3c32261
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3c32261273
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| }); | ||
| return { load, snapshot, multipleOwners: () => ownerOptions().owners.length > 1 }; | ||
| }; | ||
| const snapshot = createParkedProjection(readSnapshot, presented, prepare); |
There was a problem hiding this comment.
Preserve the cached people directory while parking
When the header menu is the directory's only observer, closing it makes createParkedProjection drop the profiles.read() dependency; projectOwner then unsubscribes, and ProfileDirectory clears result when its last listener leaves (ui/src/lib/profile-directory.ts:158-167). On the next open, the synchronous snapshot therefore contains no directory profiles, so non-self human assignees—and potentially the entire “Assign to…” entry—disappear until users.list completes, and remain unavailable if that refresh fails. Keep the directory cache observed across parking, or park only the rendered owner rows without releasing the cache that supplies them.
Useful? React with 👍 / 👎.
|
@clawsweeper re-review Final head: |
|
🦞👀 Re-review progress:
|
…n open (openclaw#174803) On busy Team the closed header session menu kept tracking live session and owner data and re-rendered on every change: r145 board reloads showed 290-583 header-menu mutations after load while the menu stayed closed. The menu now parks its presentation and owner roster while closed (createParkedProjection with a preparation signal, so the idle prewarm from openclaw#173867 still prepares rows once), and on open reconciles the delta by key instead of rebuilding. createParkedProjection gains an optional preparation argument; existing callers keep their behavior. Seven interleaved AWS c7a.4xlarge pairs with the Team-scale live-event stream: stream LoAF blocking 520 -> 407 ms (non-overlapping IQR); late header mutations 48 -> 0. After rebasing onto openclaw#174701, 3 pairs: stream blocking 371 -> 314 ms (non-overlapping), mutations 48 -> 0, first-open p50 clean 26 -> 38.2 ms and accumulated 28.8 -> 27.9 ms (within the +16 ms budget). Runtime +36 LOC. 274 focused/native tests pass; exact-head CI green apart from a plugin-steering shard failure reproduced on main.
Problem and change
A signed-in reload of a dashboard deep link keeps updating the closed header session menu during live session traffic. Campaign evidence (
EVIDENCE.md, r145) attributed 290–583 late mutations to this hidden region. The initial experiment removed that stream work but rebuilt content on opening and exceeded the first-open budget.Keep the owner rows already prepared by #173867 mounted while closed, drop their live dependencies, and reconcile by row identity before opening. Surviving rows retain their DOM nodes; only changed fields and membership update. The existing preparation signal can refresh the parked snapshot once; no extra idle scheduler is introduced. The accessible trigger label stays live. Ordering, groups, search, keyboard navigation and focus return remain with the existing menu owner.
This head includes #174701's lazy item memo and
useChatQuickActionEntries, plus main's subsequent changes through2d4ca277a8cfbfd076e2673f6fc1d4ce98c9ce53. Lazy quick-action entry construction is preserved. The separate eager owner-options memo is removed. No Gateway schema, stored shape, configuration or layout change.Combined-head CI exposed a shortcut-lifetime defect: removing the optional archive shortcut could pass an undefined combo into its still-mounted keyboard hint and halt reactivity globally, leaving Swarm history and placement controls stale. A keyed conditional now captures the valid combo until disposal. Both existing production e2e files failed before the fix and now pass standalone and in CI. The existing hint unit exercise covers eligibility transitions but did not reproduce that browser halt.
Performance: original seven pairs and final three-pair requalification
Both comparisons use quiet AWS c7a.4xlarge, production Team-scale bundles and repository headless Chromium: 300 sessions, 126 owner choices, 125 live events across 24 active sessions, a 20-second stream and the same 750 ms drain. Each sample has its own browser process/context. Clean opens precede replay; accumulated opens follow the full replay without any prior opening. Six seconds of initial preparation is shared. Stream metrics use the accumulated cohort. Values are median [Q1, Q3]; milliseconds unless stated. The comparisons use different source pairs and are not pooled.
Final gate passes through stream LoAF blocking: 15.4% lower median, non-overlapping IQRs. Busy time per event is 2.5% higher with overlapping IQRs; this is not a CPU-time win. Reload LoAF IQRs also overlap; no reload-blocking improvement is claimed.
Both final first-open p50 deltas meet the +16 ms budget. Final clean IQRs: 25.70–29.65 → 37.75–38.30; accumulated: 28.55–29.10 → 27.60–28.95. Final owner-submenu readiness p50/p90: clean 20.40/30.08 → 17.80/19.40; accumulated 19.30/19.78 → 17.50/19.34. These measure native API to visible DOM readiness, not INP or compositor presentation.
All 126 unique prepared owner nodes survive both openings in every sample, with zero additions/removals for unchanged membership. Final whole-stream header mutations are 512 → 53; after 5 seconds they are 48 → 0. The benchmark rejects browser errors; all twelve final samples completed without a recorded browser error or reactive halt.
Source and lease identities:
2b83983070664230fc3934fad18427835ceabbed, candidatea734600617d56a28f09ff0e328098ec2fea93fc5; seven pairs per condition, 28 samples. AWS leasecbx_31af1d86681c, runrun_34ed745be2bc0960489f76715ee5892e.2d4ca277a8cfbfd076e2673f6fc1d4ce98c9ce53, candidate3c32261273e5808430a97779b1dc46252562dddd; three pairs per condition, 12 samples. AWS leasecbx_7c024612965e, runrun_ddb8f1623a36041f9990ef194d74832d. Observed 16 AMD EPYC CPUs and 31 GiB RAM; one-minute sample load 0.72–3.86. Archive SHA256554fcc3845443081455665812b4277cef5114027000a1916053714aa9acbee55.Functional proof and CI
On the final exact head, 274 tests passed across 20 files: 238 focused unit/browser tests and 36 e2e tests. Coverage includes header/session/sharing/quick-action consumers, native header behavior, people search, mobile menu, header outcomes, owner assignment/warm refresh, boot render, widget chrome, Swarm history and session placement.
Commands on the final AWS lease:
Changed-test wall times: header session menu 16.484 s; chat-pane session menu 7.586 s; solo-widget chrome 27.418 s via the e2e runner. Swarm history passed 1/1 in 24.469 s; placement passed 7/7 in 33.050 s. Fresh full-diff autoreview is clean through P2; the reviewed source blobs were unchanged by the final rebase.
Exact-head CI run 39001593481 completed: 36 successful jobs, one failing test shard (
checks-ui-e2e (6/9)) and its failed aggregate gate; 26 jobs skipped. Eight of nine UI e2e shards passed. The only failed file ischat-plugin-steering.e2e.test.ts: four viewport/theme cases time out waiting for the Advisor guidance notice. The same four assertions reproduce on the exact measured main baseline2d4ca277; the failing CI job log was fetched once. No CI rerun, baseline weakening or unrelated repair was used.The full UI suite was run on the prior original candidate, not the final rebased head: 814 files passed, two failed, one skipped (3,530 tests passed, two failed, one skipped). The two failures were a dictation layout-box assertion (also reproduced on then-current main) and a real-Gateway automation fixture rejected before startup because the artifact ancestor was group-writable (same on main and candidate). The skipped desktop-resize file required an external worker carrier. Final-head proof is the focused/native runs and exact-head CI above; no claim of a final-head full-suite pass.
Production size and visual parity
+36 production LOC: 69 insertions, 33 deletions, using
git diff --stat origin/main...HEAD -- ':!*.test.ts' ':!*test-support*' ':!docs/*'. Five production files change: header session menu, session owner menu, session menu actions/view and parked projection. Three existing test files change. Retaining prepared rows while parking live dependencies and reconciling before native focus requires the growth; the eager owner-options path is deleted.Previously inspected synthetic-only before/after captures show the root menu after replay; appearance is unchanged. These captures are from the original comparison, not the final rebased head. The owner flyout is covered by retained-node measurements and behavioral tests.