Skip to content

perf(control-ui): reconcile parked header menu rows - #174803

Merged
steipete merged 7 commits into
mainfrom
steipete/coldload-header-session-menu-live-churn
Oct 17, 2026
Merged

steipete merged 7 commits into
mainfrom
steipete/coldload-header-session-menu-live-churn

Conversation

@steipete

@steipete steipete commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

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 through 2d4ca277a8cfbfd076e2673f6fc1d4ce98c9ce53. 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.

Metric Original baseline, 7 pairs Original candidate, 7 pairs Final main, 3 pairs Final candidate, 3 pairs
Stream LoAF blocking 520 [478, 554.5] 407 [404, 457.5] 371 [370.5, 386] 314 [311.5, 314]
Stream busy ms/event 34.659 [34.352, 35.419] 33.742 [33.513, 33.831] 30.515 [30.335, 30.550] 31.282 [30.438, 31.290]
Header mutations after 5 s 48 [48, 48] 0 [0, 0] 48 [48, 48] 0 [0, 0]

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.

Header first-open readiness Original baseline p50 / p90 Original candidate p50 / p90 Final main p50 / p90 Final candidate p50 / p90 Final p50 delta
Clean 25.60 / 25.94 39.00 / 40.30 26.00 / 31.84 38.20 / 38.36 +12.20
Accumulated changes 30.60 / 31.24 31.50 / 31.80 28.80 / 29.28 27.90 / 29.58 -0.90

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:

  • Original: baseline 2b83983070664230fc3934fad18427835ceabbed, candidate a734600617d56a28f09ff0e328098ec2fea93fc5; seven pairs per condition, 28 samples. AWS lease cbx_31af1d86681c, run run_34ed745be2bc0960489f76715ee5892e.
  • Final: baseline 2d4ca277a8cfbfd076e2673f6fc1d4ce98c9ce53, candidate 3c32261273e5808430a97779b1dc46252562dddd; three pairs per condition, 12 samples. AWS lease cbx_7c024612965e, run run_ddb8f1623a36041f9990ef194d74832d. Observed 16 AMD EPYC CPUs and 31 GiB RAM; one-minute sample load 0.72–3.86. Archive SHA256 554fcc3845443081455665812b4277cef5114027000a1916053714aa9acbee55.

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:

corepack pnpm test <focused-file> --maxWorkers=1
node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner <e2e-file> --maxWorkers=1

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 is chat-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 baseline 2d4ca277; 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.

Before: root header menu after synthetic live replay

After: root header menu after synthetic live replay

@clawsweeper

clawsweeper Bot commented Oct 16, 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.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 16, 2026
@clawsweeper

clawsweeper Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This 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.

  • Before: The closed header menu records 48 late mutations per measured sample.
  • After: It records zero late mutations while retaining all 126 prepared owner nodes through opening.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Focused implementation, completed paired production-browser evidence, meaningful regression coverage, and successful exact-head CI support readiness.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The exact candidate production bundles were exercised in Chromium with 300 sessions, 126 owner choices, and live-event replay; supplied measurements show zero closed-header mutations, retained nodes, and both opening conditions within budget, supported by inspected root-menu captures and reported native interaction coverage.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Performance · Worth it: Yes · Fix scope: Complete
User problem: Busy dashboard conversations spend rendering time updating a menu the user has not opened.
Reason: The maintainer-authored direction has measured streaming benefit and stays within the stated opening budget while retaining prepared rows.

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
Reviewed head: a734600617d56a28f09ff0e328098ec2fea93fc5

Before merge

None.

Findings

None.

Agent review details

How this fits together

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

Technical review

Best 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

  • Retained native header-menu presentation keeps the original intent (dc61fee: The native-menu migration retained mounted content, existing interaction behavior, and domain action authority; parking changes update timing while preserving those responsibilities.)
  • Reactive owner-menu snapshot keeps the original intent (f22af74: The Solid owner-menu refactor removed host invalidation while retaining directory loading, identity refresh, search, and reconnect behavior; this PR keeps those owners and adds keyed presentation.)
  • Parked projection preparation keeps the original intent (de691c1: Hidden retained panes drop source dependencies and catch up on reveal; the optional preparation input permits one explicit untracked refresh and leaves existing two-argument callers unchanged.)
  • Idle-prepared owner rows keeps the original intent (10ee984: The earlier idle-preparation work restored first-use latency after lazy construction; this PR preserves its prepared rows and existing preparation owner.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

  • Introduced change and opening order: The pinned introduction diff adds parked presentation and keyed reconciliation; the opening handler flushes current rows before native validation and initial focus, while the accessible session label remains live. (ui/src/pages/chat/components/chat-header-session-menu.tsx:465, a734600617d5)
  • Shared owner and caller compatibility: Owner rows retain typed identity keys, directory loading, connection-based search reset, and existing ordering; sidebar callers retain the always-present default and the existing renderer. (ui/src/components/session-owner-menu.ts:80, a734600617d5)
  • Final-head browser evidence: The body reports seven interleaved pairs for each opening condition using production bundles: streaming blocking falls from 520 to 407 ms, late header mutations fall to zero, and clean/accumulated header opening increases by 13.40/0.90 ms within the recorded 16 ms allowance; this completes the previous review's requested comparison. (a734600617d5)
  • Inspected visual parity: Both prepared final-comparison images were inspected locally and show matching root-menu layout with synthetic content; they do not show the owner flyout or independently establish performance. (a734600617d5)
  • Exact-head CI and mergeability: The live API confirms a clean, mergeable, non-draft head and successful CI run https://github.com/openclaw/openclaw/actions/runs/38986433837, including all nine UI E2E shards, both real-Gateway shards, performance, and the aggregate gate. (a734600617d5)
  • Current main and feature history: Fetched main still uses live header props and the eager owner-options memo; history identifies Peter Steinberger's native-menu, owner-projection, parking, and idle-preparation work as the central ownership trail. Follow-history encountered an unavailable older object; targeted symbol history and current-main blame remained readable. (ui/src/components/session-owner-menu.ts:29, 98f3808b30dc)

PR surface

Source +34, Tests +65. Total +99 across 7 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 4 60 26 +34
Tests 3 69 4 +65
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 129 30 +99

Review metrics

Metric Value Why it matters
Production versus test LOC Production +34 net (+60/-26); tests +65 net (+69/-4) Growth supplies keyed reconciliation and the native opening boundary, with regressions for hidden mutations and surviving owner-row identity.

Root-cause cluster

Relationship: canonical
Canonical: #174803
Summary: This PR replaces the rejected closed-menu parking experiment with measured keyed reconciliation.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.

Label justifications:

  • P2: Measured background rendering overhead affects busy dashboards, with limited blast radius and no demonstrated loss of functionality.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • 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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-16T23:09:15.382Z sha 42bc82b3f2ea943a19cc48e493e9f613af81ac43 :: needs maintainer review before merge. :: none

Reviewed October 16, 2026, 11:16 PM ET / October 17, 2026, 03:16 UTC (Revision 2).

@steipete
steipete force-pushed the steipete/coldload-header-session-menu-live-churn branch from 42bc82b to 6d6971d Compare October 16, 2026 23:18
@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 16, 2026
@steipete steipete changed the title experiment(control-ui): reconcile parked header menu rows [do not merge] perf(control-ui): reconcile parked header menu rows Oct 16, 2026
@steipete
steipete marked this pull request as ready for review October 16, 2026 23:48
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 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-17T04:14:27.285814Z 3c32261 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.

@steipete
steipete force-pushed the steipete/coldload-header-session-menu-live-churn branch 2 times, most recently from 553a939 to a734600 Compare October 17, 2026 00:27
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@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. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. 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 17, 2026
@steipete
steipete force-pushed the steipete/coldload-header-session-menu-live-churn branch from a734600 to 6f4f8a5 Compare October 17, 2026 03:35
@steipete
steipete force-pushed the steipete/coldload-header-session-menu-live-churn branch from 6f4f8a5 to 3c32261 Compare October 17, 2026 04:10

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Final head: 3c32261273e5808430a97779b1dc46252562dddd. Rebased with the lazy-entry changes; focused/native tests and the three-pair AWS requalification are complete. Exact-head CI has only the plugin-steering failure reproduced on measured main 2d4ca277; details and original seven-pair comparison are in the updated body. Stopping before merge as requested.

@clawsweeper

clawsweeper Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@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 17, 2026
@steipete
steipete merged commit 5e5ce57 into main Oct 17, 2026
107 of 112 checks passed
@steipete
steipete deleted the steipete/coldload-header-session-menu-live-churn branch October 17, 2026 04:33
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 18, 2026
…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.
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. 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. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S 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