Skip to content

fix(control-ui): preserve sidebar roster during deep-link reloads - #179254

Merged
steipete merged 13 commits into
mainfrom
steipete/coldload-sidebar-handoff-only
Oct 21, 2026
Merged

steipete merged 13 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

Peter reported a late sidebar flicker when reloading a deep link. The campaign evidence recorded 14 visible states over roughly 15 seconds for a signed-in reload of a dashboard deep link. This synthetic reproduction isolates the later cached roster → partial/blank → live roster sequence on both chat and dashboard routes.

Keep the admitted same-scope roster until the selected live query completes, then release it once at idle after the existing foreground-transcript readiness signal, bounded to 1.8 seconds after live readiness. Reuse cached row/section/rail projections and preserve row DOM identity and saved expansion. Explicit owner or Involving me selection starts its replacement query immediately; account/credential/agent invalidation still retires the cache. Live changes accumulate in the existing session owner and the handoff reads its current state.

The old consumer retired an admitted profile while hello identity was unresolved, used an unrelated canonical-list completion receipt, and lost the saved visible limit. Selected managed queries already publish complete pages atomically; the fix uses that owner rather than introducing another merge layer. Optional group-default readers and closed-menu rendering/work move behind their existing lazy boundaries to meet the unchanged chat boot budget. No avatar-policy change is included.

Evidence

Final head: a0bae01df80390bc918b5cf54a9b05a0e0315246. Runtime baseline: 029ca2bb75ab2c13dee934ab33e239c891bf7f02, with identical benchmark instrumentation in both builds.

11 interleaved baseline/candidate pairs per route on one quiet AWS c7a.4xlarge (observed 16 CPUs, 30 GiB RAM), repository headless Chromium, Team-scale synthetic fixture with 120 people, persisted expanded 20-row sidebar, avatars, and a dashboard MCP app served through the sandbox path. Connect-send floor 450 ms, response latency 250 ms; users.self 900 ms; owner-first/involving-me/counts/children 400/750/200/300 ms. All 44 untraced reloads and four separate filmstrip reloads completed.

Reproduce each paired route comparison with the committed bench (the dashboard adds --face dashboard --dashboard-mcp-app --chat-dashboard-route; omit --untraced and add --filmstrip-only --runs 2 for the separate filmstrip):

node --import ./scripts/tsx.mjs scripts/bench-control-ui-cold-load.ts \
  --bundle-dir <baseline-dist> --compare-bundle-dir <candidate-dist> \
  --warm-reload --untraced --face chat --runs 22 \
  --sidebar-avatars --sidebar-expanded --omit-hello-self-presence \
  --connect-not-before-ms 450 --method-latency-ms connect=250 \
  --method-latency-ms users.self=900 \
  --sidebar-query-latency-ms ownerFirst=400 \
  --sidebar-query-latency-ms involvingMe=750 \
  --sidebar-query-latency-ms ownerCounts=200 \
  --sidebar-query-latency-ms children=300 \
  --fixture-now-ms <one-fixed-timestamp> --probe-dir <probe-directory>

Primary gate: one roster transition, zero blank frames, no shrink/grow, retained rows. Secondary regression rule: worse with non-overlapping IQRs, or ≥9/11 worse pairs and median paired rise above max(10 ms, 3%). Both routes pass. Values are median [Q1, Q3], milliseconds where applicable. Probe timestamps are main-thread dispatch times, not network arrival. Avatar pixels are outside this roster gate.

Chat

Metric Baseline Candidate
Roster transitions 4.0 [3.0, 4.0] 1.0 [1.0, 1.0]
Blank frames 78.0 [73.0, 89.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) 280.0 [274.0, 284.0] 276.0 [266.0, 282.0]
Hello handled (ms) 774.2 [768.6, 777.6] 745.1 [742.9, 754.5]
Transcript settled (ms) 1420.8 [1405.5, 1432.8] 1463.5 [1425.5, 1484.9]
LoAF blocking (ms) 394.0 [391.0, 399.5] 351.0 [341.5, 368.5]

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

Metric Deltas
Roster transitions -2.0, -3.0, -2.0, -3.0, -3.0, -3.0, -3.0, -2.0, -2.0, -3.0, -2.0
Blank frames -55.0, -75.0, -89.0, -88.0, -55.0, -94.0, -75.0, -93.0, -78.0, -71.0, -89.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) -24.0, -8.0, -12.0, -12.0, +4.0, -12.0, -16.0, +8.0, +0.0, +16.0, +4.0
Hello handled (ms) -35.8, -23.7, -41.5, -42.0, -17.0, -23.0, -21.2, -3.2, -22.4, -25.4, -36.4
Transcript settled (ms) +27.5, +28.1, -61.3, -23.8, +69.6, +26.7, +72.0, +125.0, +61.4, +62.0, -3.2
LoAF blocking (ms) +5.0, -40.0, -62.0, -101.0, -49.0, -39.0, -47.0, +22.0, -62.0, -41.0, +78.0

Dashboard

Metric Baseline Candidate
Roster transitions 3.0 [3.0, 4.0] 1.0 [1.0, 1.0]
Blank frames 59.0 [57.5, 75.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) 288.0 [278.0, 292.0] 276.0 [264.0, 278.0]
Hello handled (ms) 825.3 [798.3, 843.1] 771.4 [759.3, 779.5]
Transcript settled (ms) 1342.8 [1309.9, 1365.0] 1366.9 [1333.1, 1381.3]
LoAF blocking (ms) 346.0 [308.5, 385.0] 295.0 [281.0, 305.0]

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

Metric Deltas
Roster transitions -2.0, -3.0, -3.0, -2.0, -2.0, -3.0, -2.0, -2.0, -2.0, -2.0, -3.0
Blank frames -56.0, -75.0, -75.0, -89.0, -58.0, -56.0, -58.0, -59.0, -57.0, -93.0, -60.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) -112.0, -12.0, -12.0, +4.0, -12.0, -40.0, -60.0, -16.0, +0.0, -8.0, +12.0
Hello handled (ms) -230.3, -37.5, -25.6, -20.1, -55.5, -109.3, -89.6, -56.7, -25.0, -23.8, -11.7
Transcript settled (ms) -126.4, +12.3, +147.8, +12.2, +93.4, -66.0, -36.0, -55.4, -8.4, +33.1, +75.2
LoAF blocking (ms) -136.0, -22.0, -1.0, -1.0, -52.0, -89.0, -123.0, -131.0, -64.0, -2.0, -43.0

Final transcript readiness, keys, and row counts match every pair: six chat rows and five dashboard rows. All runs begin with 20 cached sidebar rows; baseline ends at 10 after losing saved expansion, while candidate keeps the intended 20.

Chat settlement rises 42.7 ms between medians, with +28.1 ms median paired delta (8/11 slower). Its IQRs overlap and the paired rise is below the 42.62 ms threshold. Dashboard settlement rises 24.1 ms between medians, with +12.2 ms median paired delta (6/11 slower), overlapping IQRs and mixed signs. FCP, hello, final content, and LoAF meet the no-regression rule.

Handoff cost

The synchronous release excludes ensuing rendering. Time to the next animation frame includes rendering and scheduling, not a precise CPU duration. Baseline has no equivalent release sample.

Candidate metric Chat Dashboard
Handoff time (ms) 3160.5 [3077.3, 3260.5] 2871.9 [2825.5, 2997.0]
Synchronous release (ms) 0.1 [0.0, 0.1] 0.1 [0.0, 0.1]
Time to next frame (ms) 61.8 [60.4, 63.0] 55.8 [55.2, 56.5]

Accepted tradeoff

The lead explicitly accepted the earlier reference chat settlement cost for this visible fix: +45.1 ms between medians (1398.1 → 1443.2 ms), +30.1 ms median paired delta, 11/11 slower with separated IQRs, on reference head 120d80d599a9. This acceptance is preserved explicitly; those reference statistics are distinct from the final-head results above.

Three source-mapped chat profiles per reference variant using --cpu-profile-compare showed total sampled busy time falling 2650.8 → 2526.5 ms and sidebar rail work 67.83 → 39.88 ms inclusive. However, hello-to-transcript busy time rose 620.8 → 676.0 ms: cached-row facepile work 5.30 → 14.73 ms, avatar loader 3.16 → 10.65 ms, and chat-details 163.74 → 170.30 ms in that window. Synchronous onHello stayed essentially unchanged, 7.10 → 7.55 ms. Inclusive stacks overlap and do not add up to exact causality for the full delta. The final roster swap occurs after transcript settlement; remaining identity/avatar work is a separate follow-up.

The original #179139 profiles also placed its extra cost before paint: owner chips/facepiles +9.6 ms and sidebar indicators +10.6 ms inclusive, with pre-hello avatar requests 1 → 11; synchronous hello stayed flat. Those avatar/projection rewrites were removed before the handoff-only experiment. The retained cached-projection reuse removes repeated work without changing avatar policy.

Synthetic before/after

Full captures and filmstrips inspected: synthetic content only. Matching viewport/crop/scale; traced timestamps are inflated. The candidate retains the roster while avatar updates remain visible.

Chat before

Chat after

Dashboard before

Dashboard after

Budget and size

Chat boot JS: 1,499,913 → 1,499,305 B gzip, 608 B smaller and 695 B below the unchanged 1,500,000 B ceiling. Startup JS: 331,071 → 331,074 B; both baseline and candidate exceed the existing 325,476 B startup ceiling, and candidate differs by +3 B. No ceiling changed.

Runtime delta: +70 lines (326 additions / 256 deletions across 11 files), reduced from +81 in the accepted reference. The prescribed production-stat filter also includes benchmark/fixture helpers: 560 additions / 287 deletions, net +273 across 20 files. Growth serves bounded scheduling/cancellation, existing foreground readiness, retained cached projections, and frame-level proof. Superseded cached publications, wrong-list readiness, eager optional readers, and closed-menu scaffolding are removed.

Runtime owners touched: connection bootstrap; sidebar owner/navigation/projection/snapshot lifecycle; existing lazy menus and group-default dialogs. Supporting files extend benchmark/frame probes, synthetic fixtures, regressions, and the generated boot manifest. No server schema/stored-shape, config option, or changelog change.

Validation

AWS lease cbx_1f0867f84c9d, run run_2664b7fd0e14c5bdf570ce757747bd69, fixed c7a.4xlarge. Focused UI/script lint and production/test UI type checks pass. All 155 focused tests across eight files pass.

Remote pnpm test <file> --maxWorkers=1 wall times (test cost, not performance measurements):

File Tests Wall time
sidebar-snapshot.test.ts 30 5.38 s
app-sidebar.owner-query.test.ts 7 6.81 s
app-sidebar.projection-memo.test.ts 19 6.95 s
sidebar-menus.test.ts 8 6.57 s
session-menu-work.test.ts 8 3.74 s
app-sidebar.interactions.test.ts 75 12.40 s
connection-bootstrap.test.ts 5 3.83 s
control-ui-cold-load-probes.browser.test.ts 3 3.43 s

Regressions cover bounded release/readiness, scope cancellation, retained row DOM, new-session visibility, rename/status updates and deletion during loading, account/agent invalidation, and owner/Involving me replacement queries. The active-refresh regression fails on old source because a prior successful receipt releases stale rows while a fresh read is pending. It now also requires the selected query to stop loading. The delayed owner-selection cases fail on old source because no replacement request starts; the corrected owner starts it immediately and retains cached rows until it completes. Newer Show more/Show less intent takes precedence over the saved expansion independently per pagination map. Lazy-menu tests cover client/provider replacement, reconnect, and closing/disconnecting before the renderer finishes loading.

Native UI e2e for the touched areas: 24 tests / six files pass (135.51 s). The complete UI e2e command finished on this exact head in 6364.15 s: 840 passed, four failed, four skipped files; 3638 passed, two failed, eight skipped tests. The initial suite's failures and skips are accounted for below; the overall run is not presented as green.

Check / failure Exact-head result Control / classification
solo-widget-chrome.e2e.test.ts First case timed out awaiting the second board.update after Research widget Delete, line 247. All three cases pass in exact-head CI shard 7. The identical 10 s timeout at line 247 reproduces on the exact pre-patch main base 029ca2bb… with two workers and 11 executions. This establishes a pre-existing intermittent failure. Pinned newer main passes 3/3 and 11 selected repetitions with one worker; those passes are not claimed as a repair.
control-ui-automation-management.real-gateway.e2e.test.ts Second case fails at Crabline startup with “Private mutation boundary is writable by another POSIX principal.” Same failure reproduced on pinned main 71732925eb931a98bee830393835948992d0cfc6; first case passes on both. Environment/permission boundary, outside the sidebar flow.
tooltip-first-activation.e2e.test.ts, workboard-native-bundle.e2e.test.ts Suite hooks failed because the initial payload installed Chromium only; four tests were skipped by the failed hooks. Corrected the browser setup by installing WebKit; all four cases pass on the unchanged candidate, 54.97 s.
Four intentional live/hardware skips One case each: desktop-resize.real-gateway, peer-followup-restart.real-gateway, chat-steer-deferred-custody.real-gateway, deepseek-search.real-gateway. Not run; distinct from the four missing-WebKit hook skips above.

Changed-file checks completed on the unchanged candidate. The original 32 GiB run was OOM-killed (exit 137); the kernel log identifies the lint process. A validation-only c7a.8xlarge retry (observed 32 CPUs / 61 GiB RAM) completed. Formatting, all type checks, i18n/controller guards and core/script lint pass; core lint reports zero errors. The command exits 1 on three structural guards:

  • Max-lines suppression ratchet: chat-message.test.tsx, config-page-state.ts, sessions-page-state.ts.
  • Core tsgo graph boundary: five test roots exceed the existing 720-file ceiling (candidate counts 722, 723, 726, 746, 728).
  • Dead exports: inspectOwnGitHubPullRequest, NormalizedHeartbeatDelivery, baseStatusCfg.

All three guards reproduce on the exact pre-patch main base 029ca2bb75ab2c13dee934ab33e239c891bf7f02, with the same offending files, five root counts, and three unused exports. The newer pinned main also fails these guards, although its dead-export inventory changed after unrelated refactors. These are inherited failures; no guard, baseline, or limit was changed.

Exact-head CI run 39593574560 is complete: 68 passing check entries, three failing entries (one underlying failure plus two aggregate gates), 36 skipped and none pending at the recorded audit. The sole underlying failure is UI e2e shard 1: the unchanged compact account-menu row-height assertion at 390 px compares 306.0000305175781 with 305.9999694824219 (difference 0.000061035 px; tolerance 0.00005 px). The test passes in the candidate full-suite run. Main fixes this exact assertion's excessive precision in #179307 (d2590fe90720); the full publication file passes 29/29 on pinned main, and the selected case passes 11 repetitions with that upstream fix. The original four-decimal assertion also fails on the pre-patch main base with the same 0.000061035 px difference during the two-worker repetition control. Performance CI passes; UI e2e shard 7 passes 100 files / 473 tests, including all solo-widget cases. No CI rerun or assertion/ceiling change was used to chase green.

Additional AWS validation/control receipts:

Lease / instance Run Purpose
cbx_4f8b2c485d72 / c7a.8xlarge run_235ca9141bc39ee712bb1f07458fcaa1 Candidate WebKit replays and completed changed-file checks after the confirmed OOM.
cbx_7ddb795bd831 / c7a.4xlarge run_6786c665da68944b40a44598747b4c44, run_768ebbab2aadce65c8450295ba955def Pinned-main failure classification and 11 repetitions of the two selected browser cases.
cbx_853eec4c9956 / c7a.4xlarge run_ca32bb2bd18d824a4fccfafc391c886b Exact pre-patch main base 029ca2bb…: original browser assertions with two workers, plus the three structural guards.

Final complete-branch independent autoreview is clean through P2, exit 0, on the unchanged final source. The three earlier P2s (pagination intent, owner/Involving me replacement-query admission, and loading-state readiness) are covered by failing-before/passing-after regressions. All task-owned AWS leases are released with confirmed stop receipts. No local Gateway remains running.

No merge requested; the lead owns landing. Avatar/identity presentation remains a separate follow-up.

@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 complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

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
@steipete steipete changed the title experiment(control-ui): defer sidebar roster handoff [do not merge] perf(control-ui): keep cached sidebar stable through live handoff Oct 21, 2026
@steipete
steipete marked this pull request as ready for review October 21, 2026 08:16
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 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 🔄 Running since 2026-10-21T11:39:41.796144Z a0bae01 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.

@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: e5a7a0c655

ℹ️ 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".

Comment thread ui/src/components/app-sidebar-owner.tsx Outdated
Comment on lines +126 to +129
this.sessionData.visibleSessionLimits = new Map(
snapshot.sections.map((section) => [section.id, section.visibleLimit]),
);
this.rosterVisibleSessionLimits = new Map(this.sessionData.visibleSessionLimits);

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 pagination changes made before snapshot handoff

When a user clicks Show more or Show less while the warm snapshot is held—now potentially for 1.8 seconds—setVisibleSessionLimit records the new foreground limit in sessionData.visibleSessionLimits or rosterVisibleSessionLimits. This handoff then unconditionally replaces both maps with limits captured on the previous page load, discarding the user's newer intent and potentially shrinking the live list again. Seed only missing section limits or otherwise preserve the current owner values.

AGENTS.md reference: ui/AGENTS.md:L16-L19

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 120d80d599a98627c853227799f61460cbd81de9. Each pagination map now overlays its own newer choices on the cached defaults, so Show more and Show less selections survive handoff. Both DOM regression cases fail on the preceding owner and pass with the fix; the projection suite passes 19/19. The experiment is closed unmerged because the final chat transcript-settlement comparison fails its separate performance gate.

@steipete
steipete force-pushed the steipete/coldload-sidebar-handoff-only branch from e5a7a0c to ee447c5 Compare October 21, 2026 08:30
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed 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
@clawsweeper

clawsweeper Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR retains cached sidebar projections until the selected live list settles and preserves saved expansion through handoff.

Example: Reload a chat deep link with 20 saved sidebar rows.

  • Before: The sidebar becomes partial, goes blank, and finishes with 10 rows.
  • After: The 20 cached rows stay mounted until the live list replaces them.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Strong visual and paired performance evidence supports the main behavior, but the confirmed pagination overwrite blocks merge.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after chat and dashboard filmstrips exercise the production Control UI bundle with synthetic transport, delayed identity and list replies, and saved expansion; candidate rows remain visible through handoff.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Reloading a chat or dashboard can blank and rebuild the sidebar and lose its saved expansion.
Reason: The inspected captures demonstrate a visible improvement, and maintainer authorship establishes direction and accepts the documented performance tradeoff.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this PR open: the visual proof supports the sidebar improvement, but handoff still overwrites pagination choices made during reload.

Priority: P2
Reviewed head: ee447c53c95dbb78330817b90b2c1a8900aec11f

Before merge

  • Preserve current pagination limits when releasing the snapshot (P2) - With a saved 20-row section, clicking Show more while the snapshot is held records a current limit of 30 through setVisibleSessionLimit. These assignments then replace that value with the saved limit of 20 at handoff, discarding the click. A saved 40-row section similarly overwrites a Show less choice of 10. Seed missing limits while preserving existing values independently in visibleSessionLimits and rosterVisibleSessionLimits, and cover pagination before handoff in the mounted regression.

Findings

  • [P2] Preserve current pagination limits when releasing the snapshot — ui/src/components/app-sidebar-owner.tsx:126-129
Agent review details

How this fits together

The Control UI sidebar combines a scoped boot snapshot, live session queries, and foreground transcript readiness to render session navigation.

flowchart LR
  A[Saved sidebar snapshot] --> B[Snapshot lifecycle owner]
  C[Live session query] --> B
  D[Foreground transcript readiness] --> B
  B --> E[Sidebar projections]
  E --> F[Mounted session rows]
Loading

Technical review

Best possible solution:

Keep the selected-query handoff and memo reuse, but seed saved limits only where each current pagination owner has no newer value.

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

The inspected baseline/candidate captures establish the reload problem, and the pagination overwrite follows directly through the production click handler and handoff method; no target code was executed during this review.

Is this the best way to solve the issue?

The change repairs the existing snapshot consumer and reuses the bootstrap and projection owners, with one necessary correction to preserve newer pagination intent.

Full review comments:

  • [P2] Preserve current pagination limits when releasing the snapshot — ui/src/components/app-sidebar-owner.tsx:126-129
    With a saved 20-row section, clicking Show more while the snapshot is held records a current limit of 30 through setVisibleSessionLimit. These assignments then replace that value with the saved limit of 20 at handoff, discarding the click. A saved 40-row section similarly overwrites a Show less choice of 10. Seed missing limits while preserving existing values independently in visibleSessionLimits and rosterVisibleSessionLimits, and cover pagination before handoff in the mounted regression.
    Confidence: 0.99
    Late finding: first raised on code an earlier review cycle already covered.

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Scoped sidebar snapshot and live handoff keeps the original intent (561d92d: Unify boot routing and sidebar presentation while keeping cached rows display-only and actions under live authority.)
  • Snapshot lifetime and deferred capture keeps the original intent (9fa4e56: Retain the synchronous snapshot owner across Solid view recreation and capture after committed rendering; later capture coalescing avoids repeated construction.)
  • Foreground transcript admission keeps the original intent (b023df8: Keep automatic background lists from competing with the selected transcript until it has an authoritative visible outcome.)
  • Cached-state publication changes intended behavior with a stated reason (2984089: Suppress unchanged live-event presentation while preserving visible updates; this PR explains and measures replacing unconditional cached publications with one bounded handoff.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test ui/src/components/app-sidebar.projection-memo.test.ts --maxWorkers=1
  • pnpm test ui/src/components/sidebar-snapshot.test.ts --maxWorkers=1
  • pnpm tsgo:ui
  • pnpm check:changed

What I checked:

PR surface

Source +76, Tests +159, Docs +7, Other +132. Total +374 across 17 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 6 105 29 +76
Tests 8 168 9 +159
Docs 1 7 0 +7
Config 0 0 0 0
Generated 0 0 0 0
Other 2 151 19 +132
Total 17 431 57 +374

Review metrics

Metric Value Why it matters
Runtime versus regression tests Runtime +105/−29 lines; tests +111/−3 lines Runtime growth supports bounded handoff scheduling and existing projection reuse; the added tests cover distinct lifecycle and DOM-retention failures.
Benchmark options 4 new benchmark flags; 0 product configuration options The flags control synthetic avatars, saved expansion, delayed self identity, and query-specific latency for the existing reproduction.

Root-cause cluster

Relationship: canonical
Canonical: #179254
Summary: This PR continues the same sidebar handoff repair with projection reuse after the earlier experiment failed its performance gate.

Members:

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

Labels

Label changes:

  • add P2: The reload improvement has clear value, while the remaining defect discards a recoverable sidebar pagination choice.
  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P2: The reload improvement has clear value, while the remaining defect discards a recoverable sidebar pagination choice.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

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 21, 2026, 5:14 AM ET / 09:14 UTC.

@steipete
steipete force-pushed the steipete/coldload-sidebar-handoff-only branch from ee447c5 to 9441f75 Compare October 21, 2026 09:16
@steipete
steipete force-pushed the steipete/coldload-sidebar-handoff-only branch from 9441f75 to 120d80d Compare October 21, 2026 09:18

@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: 120d80d599

ℹ️ 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".

Comment on lines +55 to +58
if (hasSidebarListFilter(host)) {
const query = host.sessionData.sessionListQuery(host.expandedAgentId());
const selected = context.sessions.listSnapshot(query);
return selected.readSucceeded === true || selected.error !== null;

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 Honor owner-filter changes before releasing the snapshot

When the user changes the owner or Involving me filter during the new handoff delay, SessionOwnerFilter records the choice, but sidebarSessionOwnerFilter() continues returning the cached snapshot's filter until that snapshot is released. This readiness check therefore keeps evaluating the old query as settled, allowing the timer/idle callback to release the cache before the newly selected query has even started; the sidebar can then briefly present rows for the previous owner or an empty client-filtered list while the new request runs. Treat the foreground filter change as a snapshot invalidation, or evaluate settlement against the recorded current intent rather than the snapshot-owned filter.

AGENTS.md reference: ui/AGENTS.md:L16-L19

Useful? React with 👍 / 👎.

@steipete
steipete marked this pull request as draft October 21, 2026 09:28
@steipete steipete changed the title perf(control-ui): keep cached sidebar stable through live handoff experiment(control-ui): deferred sidebar roster handoff [do not merge] Oct 21, 2026
@steipete steipete closed this Oct 21, 2026
@steipete steipete reopened this Oct 21, 2026

@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: 688860f1ff

ℹ️ 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".

Comment on lines +55 to +58
if (hasSidebarListFilter(host)) {
const query = host.sessionData.sessionListQuery(host.expandedAgentId());
const selected = context.sessions.listSnapshot(query);
return selected.readSucceeded === true || selected.error !== null;

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 Wait for cached filtered queries to finish refreshing

When the user returns to an owner or Involving-me filter whose managed window previously succeeded, the foreground refresh preserves readSucceeded: true while setting loading: true (session-managed-list-refresh.ts:167). This check therefore treats the stale window as settled and can release the warm snapshot before the newly requested authoritative refresh completes, reintroducing a cached-to-stale-to-live roster transition during the handoff delay. This is fresh evidence for the earlier owner-filter finding: require !selected.loading here, as the roster branch already does, before accepting either success or error.

AGENTS.md reference: ui/AGENTS.md:L16-L19

Useful? React with 👍 / 👎.

@steipete
steipete force-pushed the steipete/coldload-sidebar-handoff-only branch from 688860f to a9526ba Compare October 21, 2026 11:00
@steipete
steipete force-pushed the steipete/coldload-sidebar-handoff-only branch from a9526ba to a0bae01 Compare October 21, 2026 11:39
@steipete

Copy link
Copy Markdown
Contributor Author

All three P2 findings are addressed in a0bae01df80390bc918b5cf54a9b05a0e0315246:

  • Each pagination map preserves newer Show more/Show less intent over cached defaults; both mounted DOM regressions fail before the correction and pass afterward.
  • Owner/Involving me selection starts the newly selected managed query immediately, retaining cached rows until that query completes. Both delayed-query regressions fail before the correction and pass afterward.
  • A previously successful managed query must also have loading === false before handoff. The active-refresh regression fails on the old receipt check and passes on this head.

The final independent complete-branch autoreview is clean through P2. The PR body now contains exact-head 11-pair chat/dashboard measurements, inspected synthetic filmstrips, accepted settlement tradeoff, 695 B chat budget headroom, and complete validation/failure classification. Full UI e2e and changed-file checks completed; the remaining failures were reproduced on pre-patch main or pinned newer main, with the excessive account-menu precision independently fixed upstream in #179307. No assertion or budget ceiling was changed here, and no merge was performed.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete
steipete merged commit 5b1b96b into main Oct 21, 2026
132 of 135 checks passed
@steipete
steipete deleted the steipete/coldload-sidebar-handoff-only branch October 21, 2026 15:00
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 22, 2026
…place it once (openclaw#179254)

Peter (2026-10-20): "the sidebar has a late reload flicker that looks ugly". Live filmstrips on Team: on chat deep links the warm cached sidebar shrank to a partial list ~3.2 s into a reload and grew back with avatars ~110 ms later; on the dashboard route the session list went completely blank for ~1 s first. Two causes: when hello arrived before the user identity resolved, the snapshot scope's profileId briefly became null, retiring the admitted cached roster (blank list); and live sessions.list results were published per query (partial list) instead of once.

Keep the admitted boot profile while hello's selfUser is unresolved (a different resolved user still changes scope and replaces), hold the cached roster until the foreground pane is ready plus an idle period (1.8 s cap), then hand off to the live roster once with row identity preserved; sidebar menus and group dialogs move behind their lazy boundaries to keep chat boot JS under budget.

Evidence (AWS c7a.4xlarge, 11 pairs per route, per-frame sidebar DOM probe + filmstrips): roster transitions chat 4 -> 1, dashboard 3 -> 1; blank frames 78 -> 0 / 59 -> 0; 20 cached rows retained; FCP 280 -> 276 / 288 -> 276 ms; hello 774 -> 745 / 825 -> 771 ms; LoAF 394 -> 351 / 346 -> 295 ms; transcript settled +28.1 / +12.2 ms paired (within the no-regression rule; an earlier +45 ms chat variant was explicitly accepted and is documented in the PR). Chat boot JS 1,499,305 B gzip (-608 B, 695 B headroom).

Runtime +70 LOC (11 files; most of the line count moves menu rendering behind its lazy boundary). 155 focused + 24 native e2e tests; full UI e2e and changed checks (remaining failures reproduce on pre-patch or newer main); exact-head CI red only on the account-menu precision assertion fixed upstream in openclaw#179307. Avatar initials -> image swaps remain a separate follow-up.
RomneyDa added a commit that referenced this pull request Oct 29, 2026
…olved peer identity; realign quota catalog e2e (#187594)

* test(ui): expect held catalog refresh to complete across quota recovery

Backport e8dd49e (#185250, main 77af976) keeps the prepared runtime
and its catalog owner through cooldown/blocked availability updates, so a quota
recovery no longer supersedes an in-flight catalog generation. The
automatic-during-catalog quota e2e still expected the held models.list refresh
to fail with "catalog generation was superseded". Main realigned this assertion
to the intended behavior in fc0e45a (#184971); that commit is a large CI
change, so carry only the assertion: the held refresh resolves ok and the
published catalog still reports gpt-5.5 available after it lands.

Refs fc0e45a

* fix(control-ui): keep the admitted sidebar scope while hello identity is unresolved

Backport 99e458b (#185762, main 8d0f6fb) stopped an unresolved peer
tab from persisting a profile-less boot record, but on main that fix sits on
top of #179254 (5b1b96b), which also keeps the admitted boot profile in
the sidebar snapshot scope until hello's selfUser resolves. Release lacks
#179254 (Solid-era handoff/perf work), so a peer tab that booted with the
operator's sidebar scope still recomputed profileId as null on hello, retired
that scope, and deleted the operator's cached sidebar snapshot. The next
reload then rendered the sidebar live instead of from cache.

Port only #179254's identity rule into the Lit SidebarSnapshotController:
keep the admitted profile while selfUser is undefined (a resolved different
user or an explicit null still replaces the scope) and skip capture under a
profile scope until identity resolves. Add main's unit regression adapted to
the release controller (fails without the runtime change).

The #185762 e2e waited for an 11th recent row, which main serves through its
#172946 sessions.list owner fixture; the backport dropped those handlers, so
the count could never be reached on release (it failed at 99e458b
itself). Assert instead that the cached reload shows the rows the operator's
page saved, which exceeds the single live row a held connect renders.

Refs 5b1b96b
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 P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts size: XL status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant