Repository navigation
fix(control-ui): preserve sidebar roster during deep-link reloads - #179254
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 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. |
There was a problem hiding this comment.
💡 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".
| this.sessionData.visibleSessionLimits = new Map( | ||
| snapshot.sections.map((section) => [section.id, section.visibleLimit]), | ||
| ); | ||
| this.rosterVisibleSessionLimits = new Map(this.sessionData.visibleSessionLimits); |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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.
e5a7a0c to
ee447c5
Compare
|
Codex review: needs changes before merge. What this changesThis 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.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete 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 Before merge
Findings
Agent review detailsHow this fits togetherThe 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]
Technical reviewBest 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:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against fef54024017f. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceAcceptance criteria:
What I checked:
PR surfaceSource +76, Tests +159, Docs +7, Other +132. Total +374 across 17 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 Reviewed October 21, 2026, 5:14 AM ET / 09:14 UTC. |
ee447c5 to
9441f75
Compare
9441f75 to
120d80d
Compare
There was a problem hiding this comment.
💡 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".
| if (hasSidebarListFilter(host)) { | ||
| const query = host.sessionData.sessionListQuery(host.expandedAgentId()); | ||
| const selected = context.sessions.listSnapshot(query); | ||
| return selected.readSucceeded === true || selected.error !== null; |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
💡 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".
| if (hasSidebarListFilter(host)) { | ||
| const query = host.sessionData.sessionListQuery(host.expandedAgentId()); | ||
| const selected = context.sessions.listSnapshot(query); | ||
| return selected.readSucceeded === true || selected.error !== null; |
There was a problem hiding this comment.
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 👍 / 👎.
688860f to
a9526ba
Compare
a9526ba to
a0bae01
Compare
|
All three P2 findings are addressed in
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 |
|
🦞👀 Re-review progress:
|
…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.
…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
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.self900 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--untracedand add--filmstrip-only --runs 2for the separate filmstrip):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
Per-pair deltas (candidate − baseline), pairs 1–11:
Dashboard
Per-pair deltas (candidate − baseline), pairs 1–11:
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.
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-compareshowed 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. SynchronousonHellostayed 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.
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, runrun_2664b7fd0e14c5bdf570ce757747bd69, fixedc7a.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=1wall times (test cost, not performance measurements):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.
solo-widget-chrome.e2e.test.tsboard.updateafter Research widget Delete, line 247. All three cases pass in exact-head CI shard 7.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.ts71732925eb931a98bee830393835948992d0cfc6; first case passes on both. Environment/permission boundary, outside the sidebar flow.tooltip-first-activation.e2e.test.ts,workboard-native-bundle.e2e.test.tsdesktop-resize.real-gateway,peer-followup-restart.real-gateway,chat-steer-deferred-custody.real-gateway,deepseek-search.real-gateway.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.8xlargeretry (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:chat-message.test.tsx,config-page-state.ts,sessions-page-state.ts.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:
cbx_4f8b2c485d72/c7a.8xlargecbx_7ddb795bd831/c7a.4xlargecbx_853eec4c9956/c7a.4xlarge029ca2bb…: 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.