Skip to content

experiment(control-ui): sidebar roster handoff only [do not merge] - #179178

Closed
steipete wants to merge 2 commits into
mainfrom
steipete/coldload-sidebar-handoff-only
Closed

steipete wants to merge 2 commits into
mainfrom
steipete/coldload-sidebar-handoff-only

Conversation

@steipete

@steipete steipete commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

A signed-in reload of a dashboard or chat deep link can discard its warm sidebar at hello, show a partial list, go blank, and rebuild the list. The campaign evidence measured 14 visual states in the original reload waterfall; the later sidebar-specific reproduction isolated the cached → partial → blank → live sequence. No private captures or account data are included here.

Decision

Stop: the handoff-only experiment passes the visible roster gate but fails the secondary performance gate. Do not merge. Both routes retain all 20 cached row elements, with exactly one roster transition, zero blank frames, and no shrink-grow in all 11 candidate reloads. Transcript settlement and LoAF blocking regress under the predeclared rule. The lead must explicitly accept that cost before any landing work resumes.

Change and Attribution

The runtime diff is +15 lines across three existing owners. Unresolved hello identity preserves the already admitted boot profile; resolved null/different profiles and account/connection changes still retire it. The filtered sidebar waits for its selected managed query's completion receipt instead of the unrelated canonical list. At that handoff, the existing saved section limits are restored. Snapshot writes remain blocked under an unresolved non-null profile. No avatar, identity-owner, schema, or projection rewrite is included.

The partial lists are different query scopes: the canonical owner-first response is not a completion receipt for the selected involving-me list. Its managed query already publishes complete pages atomically, so the smaller patch waits for that existing owner instead of introducing a cross-query merge. The old snapshot readiness check released the display against the wrong completion receipt. Separately, undefined self identity was interpreted as a profile change at hello, clearing the admitted snapshot. Losing saved visible limits then reduced the restored 20-row selection to 10 rows.

Before cutting this patch, three source-mapped chat profiles per variant compared #179139 with its runtime changes removed, using --cpu-profile-compare. Pre-FCP owner chips/facepiles added about 9.6 ms inclusive; sidebar indicators about 10.6 ms; avatar loading about 5.3 ms nested within that work. These inclusive times overlap and must not be summed. Pre-hello avatar requests rose 1 → 11, total 14 → 24. Sampled onHello remained 7.43 → 7.46 ms; connect dispatch stayed about 0.5 ms. Cached row reconstruction rose 3.22 → 14.94 ms over the load. Sampled busy time was 416.8 → 426.4 ms before FCP, 262.4 → 276.9 ms from FCP to hello, and 649.6 → 720.3 ms from hello to transcript catch-up. The evidence points to rendering and layout, not a new awaited read or synchronous hello merge. These profiled times are attribution, not gate measurements.

Evidence

11 interleaved baseline/candidate pairs per route on one quiet AWS c7a.4xlarge lease, repo headless Chromium, Team-scale fixture with 120 people, synthetic avatars, persisted expanded 20-row sidebar, and synthetic MCP dashboard through the sandbox path. Connect-send floor 450 ms and response 250 ms; users.self 900 ms; owner-first/involving-me/counts/children latencies 400/750/200/300 ms. Load average at the qualified run start: 1.02 on 16 CPUs. All timing results below are remote and untraced; filmstrip runs are separate.

Measured runtime head: fcf250d20c8d9373eadccc7b7446a9ea375bf10b, baseline runtime 74d4b5f14301 with the same measurement tooling. The final benchmark-only correction was applied identically to both variants before the qualified comparison. Earlier short-list runs were discarded: sticky rows had been mistaken for a persisted expansion, and the installed Playwright treats an async waitForFunction predicate as a truthy Promise. The corrected setup explicitly awaits the saved limit and row membership. The dashboard setup uses the current Dashboard options menu and verifies its main-pane placement.

Regression rule: non-overlapping IQRs, or ≥9/11 worse pairs with median paired rise above max(10 ms, 3%). Values are median [Q1, Q3]; times are milliseconds.

Chat

Metric Baseline Candidate
Roster transitions 4.0 [4.0, 4.0] 1.0 [1.0, 1.0]
Blank frames 93.0 [90.5, 94.0] 0.0 [0.0, 0.0]
Minimum sidebar rows 0.0 [0.0, 0.0] 20.0 [20.0, 20.0]
Final sidebar rows 10.0 [10.0, 10.0] 20.0 [20.0, 20.0]
Cached DOM rows retained 0.0 [0.0, 0.0] 20.0 [20.0, 20.0]
FCP (ms) 272.0 [266.0, 280.0] 280.0 [266.0, 286.0]
Hello handled (ms) 754.6 [747.2, 757.4] 755.3 [747.0, 763.0]
Transcript settled (ms) 1388.3 [1370.0, 1395.0] 1471.8 [1453.4, 1512.0]
LoAF blocking (ms) 341.0 [335.0, 348.0] 394.0 [383.5, 412.0]

Per-pair deltas (candidate − baseline), pairs 1–11:

Metric Deltas
Roster transitions -3.0, -3.0, -3.0, -3.0, -3.0, -3.0, -2.0, -3.0, -3.0, -3.0, -3.0
Blank frames -90.0, -90.0, -94.0, -93.0, -94.0, -93.0, -96.0, -91.0, -94.0, -95.0, -90.0
Minimum sidebar rows +20.0, +20.0, +20.0, +20.0, +20.0, +20.0, +20.0, +20.0, +20.0, +20.0, +20.0
Final sidebar rows +10.0, +10.0, +10.0, +10.0, +10.0, +10.0, +10.0, +10.0, +10.0, +10.0, +10.0
Cached DOM rows retained +20.0, +20.0, +20.0, +20.0, +20.0, +20.0, +20.0, +20.0, +20.0, +20.0, +20.0
FCP (ms) +0.0, -16.0, +20.0, -8.0, +16.0, +0.0, +0.0, +4.0, +8.0, +20.0, +4.0
Hello handled (ms) +5.2, -16.6, +16.0, +1.4, +6.4, +16.5, -5.0, +6.3, +10.5, +2.5, -9.2
Transcript settled (ms) +113.7, +69.6, +169.5, +79.7, +78.1, +126.4, +17.2, +124.9, +146.4, +38.5, +94.2
LoAF blocking (ms) +28.0, +66.0, +95.0, +35.0, +55.0, +107.0, +11.0, +56.0, +102.0, -3.0, +16.0

Dashboard

Metric Baseline Candidate
Roster transitions 4.0 [3.5, 4.0] 1.0 [1.0, 1.0]
Blank frames 91.0 [90.5, 92.0] 0.0 [0.0, 0.0]
Minimum sidebar rows 0.0 [0.0, 0.0] 20.0 [20.0, 20.0]
Final sidebar rows 10.0 [10.0, 10.0] 20.0 [20.0, 20.0]
Cached DOM rows retained 0.0 [0.0, 0.0] 20.0 [20.0, 20.0]
FCP (ms) 264.0 [262.0, 280.0] 280.0 [274.0, 282.0]
Hello handled (ms) 766.4 [754.1, 790.2] 785.2 [764.6, 794.7]
Transcript settled (ms) 1220.9 [1184.6, 1306.1] 1341.9 [1315.8, 1350.0]
LoAF blocking (ms) 275.0 [259.0, 293.5] 311.0 [288.0, 321.0]

Per-pair deltas (candidate − baseline), pairs 1–11:

Metric Deltas
Roster transitions -3.0, -3.0, -3.0, -3.0, -3.0, -3.0, -3.0, -2.0, -3.0, -2.0, -2.0
Blank frames -92.0, -85.0, -93.0, -92.0, -91.0, -91.0, -90.0, -91.0, -91.0, -90.0, -94.0
Minimum sidebar rows +20.0, +20.0, +20.0, +20.0, +20.0, +20.0, +20.0, +20.0, +20.0, +20.0, +20.0
Final sidebar rows +10.0, +10.0, +10.0, +10.0, +10.0, +10.0, +10.0, +10.0, +10.0, +10.0, +10.0
Cached DOM rows retained +20.0, +20.0, +20.0, +20.0, +20.0, +20.0, +20.0, +20.0, +20.0, +20.0, +20.0
FCP (ms) -92.0, +8.0, +8.0, +16.0, +4.0, +16.0, +16.0, +0.0, +20.0, +0.0, +20.0
Hello handled (ms) -184.7, +10.0, +0.7, +28.1, +40.1, +11.8, +36.9, -0.8, +17.6, +2.5, +11.3
Transcript settled (ms) -174.8, +141.1, +108.8, +168.4, +160.1, +129.8, +85.7, +20.5, +125.7, +33.0, +75.3
LoAF blocking (ms) -137.0, +99.0, +7.0, +60.0, +56.0, +41.0, +68.0, -71.0, +32.0, +8.0, +34.0

Chat transcript settlement is worse in 11/11 pairs, median paired +94.2 ms, with separated IQRs. Chat LoAF also has separated IQRs. Dashboard transcript settlement has separated IQRs and is worse in 10/11 pairs, median paired +108.8 ms. Dashboard LoAF is worse in 9/11 pairs, median paired +34 ms, so it fails despite overlapping IQRs. FCP and hello-handled do not regress under the declared rule. Final transcript keys and readiness match exactly within every pair (6 chat rows, 5 dashboard rows). Chat RPCs decrease 110 → 68; dashboard median RPCs decrease 143 → 104. Fewer RPCs did not offset the render cost.

Synthetic filmstrips

Synthetic filmstrips remain available in the prior body revision.

Inspected synthetic-only captures; no private capture is uploaded. Filmstrip timestamps are traced and inflated. The roster remains in place in the candidate while avatar changes remain visible.

Avatar Follow-up

Live ownership visibility replaces cached display facts; credential-context changes at hello reset the avatar blob loader; the pending replacement image path removes the previous src. This explains a blank/initials/image sequence and revision-dependent refetches. No avatar fix is included. The next investigation should preserve an admitted cached image through the credential-context handoff without conflating different credential scopes.

Validation and Gaps

Snapshot regression is red on the base (unresolved hello clears cached rows), green on the candidate: 27 passed. pnpm test ui/src/components/sidebar-snapshot.test.ts --maxWorkers=1: remote wall 5.32 s; local wrapper wall 9.79 s. Native UI e2e: 4 files / 7 tests passed, 90.02 s (sidebar-cold-load, sidebar-cached-list-stability, session-owner-warm-refresh, dashboard-cold-load). Full UI e2e, changed-file gate, and the broader new/rename/status/delete live-update matrix were not run because the performance stop gate failed. This is not a landing-ready PR.

Runtime and benchmark correction autoreviews are scoped-clean through P2. Attribution lease cbx_00675d64b12d, run run_ec864fd7ab8fb09dd777f6dd1cf3cc2e, was released. Comparison/proof lease cbx_5c2b730ea652, broker run run_033cf255f2a3f6a416551de07ea22839; the first wrapper command was deliberately stopped with exit 143 after detecting invalid setup, then the qualified comparison and focused tests ran via its retained SSH connection with pinned runtime source. No Gateway or real account was used.

Minimal-patch CPU attribution

Three additional source-mapped chat profiles per variant (--cpu-profile-compare) isolate the remaining cost after hello. Sampled pre-FCP busy time is 427.8 → 413.1 ms; FCP-to-hello is 295.6 → 294.1 ms; gateway-store.ts:onHello is 7.69 → 6.61 ms and connect dispatch has a 0.5 ms median in both. There is no measured extra pre-paint or synchronous hello workload in this smaller patch.

Hello-to-transcript sampled busy time rises 634.6 → 751.9 ms. The extra work is distributed across the existing sidebar/rail rendering and layout path: chat position-rail controller +16.6 ms inclusive, sidebar rail +10.8 ms, sidebar render +7.8 ms, row render +7.6 ms, and identity-avatar loader +6.7 ms. Keeping the cached projection alive also increases restoreSnapshotSession from 1.92 → 13.25 ms over the whole load. Those inclusive stacks overlap; they do not sum to a causal accounting of the timing delta. Total sampled busy time changes only 2727.2 → 2759.2 ms, so the critical-path regression includes redistribution of existing work, not just added total CPU. The 20-row retained display continues to receive reactive updates while live queries settle. The four-line visible-limit restoration executes later, at handoff, after the transcript-settlement regression has already occurred.

This localizes the remaining issue to post-hello rendering/layout while retaining the cached roster. It does not prove that the cost is inherent to all possible handoff implementations. Further projection or scheduling changes would be another experiment, outside this stopped handoff-only patch.

Scope, Size, and Final State

Runtime LOC: +15 (16 additions / 1 deletion across the three runtime files). The prescribed production-stat filter includes benchmark/documentation/fixture helpers: 200 additions / 25 deletions, net +175, across 10 non-test files. The snapshot regression test adds net +21 lines. Growth is required to distinguish unresolved admitted identity, wait for the correct list receipt, retain saved expansion, and measure the intermediate DOM states; no competing runtime owner was added. The superseded unconditional null-profile interpretation and unrelated-list readiness path for filtered views are replaced.

Files: app-sidebar-owner.tsx, sidebar-snapshot.ts, sidebar-snapshot-capture.ts, sidebar-snapshot.test.ts; the existing cold-load benchmark and its documentation/frame probe; four existing Team-scale/latency fixture helpers. No Gateway, stored server shape, config option, or changelog change.

Final source branch was rebased onto current main, preserving the overlapping allocation/sidebar probe changes. Final experiment head: c7a1044ade3e429728a119f0b4bf53b5f1a61a85; the performance tables above remain evidence for the pinned measured runtime revision, not a claim of remeasurement after rebase. Team-scale fixture tests on the rebased head: 6 passed (5.27 s test duration; wrapper 11.84 s). Both owned AWS leases are confirmed released. No Gateway was started. The branch is retained for inspection; the experiment is closed unmerged.

Rebased cold-load probe browser tests: 3 passed (2.56 s; wrapper 7.55 s). No CI failure is being waived for landing: this draft experiment is stopped and unmerged.

The final rebased branch autoreview is also scoped-clean through P2. The conflict resolution retains both sides' probe controls. CI status will be recorded on this exact final head; draft/skipped jobs are not counted as broad proof.

Final CI on c7a1044ade3e429728a119f0b4bf53b5f1a61a85: 8 successful checks, 62 skipped, no failures. The last running job, actionlint, completed successfully in exact-head run 39562225043. Draft CI skipped the broad UI/test lanes; no full-suite or landing-green claim is made.

@clawsweeper

clawsweeper Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review in progress

ClawSweeper is reviewing this revision. This supersedes any previous blocked status.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui scripts Repository scripts size: M labels Oct 21, 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 21, 2026
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 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. scripts Repository scripts size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant