Repository navigation
fix(ui): stop warm sidebar refreshes from blanking foreign-owned rows - #129558
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Real-render proof (real Chromium against the built Control UI, mock gateway holding the warm refresh open at its vulnerable point — the shared phase deferred after a Before (pre-fix roster code): the moment the provisional owner window publishes, Bob's session leaves the DOM — the sidebar shows only the signed-in user's row until the shared merge lands. This is the blink team.openclaw.ai users see under event load. The new e2e fails here with After (this PR): both rows stay in the DOM through the entire deferred window (sampled 6× at 100ms) and after the merge. First image: pre-fix frame from the failure video (owner-only sidebar). Second and third: fixed tree during the deferred window and after the merge. |
|
Live-gateway proof (isolated Steady-state under load — 182 samples over 55s while seven concurrent live agent runs streamed: exactly one distinct row-set state (no blank samples, New-session admission — with the dashboard open, a brand-new session was admitted to the sidebar in 1.8s, rows went 7→8 with no sample ever dipping below baseline, and all 7 pre-existing rows survived the insert-at-top as the same DOM nodes ( Video is the full 55s sampling window; screenshot is the post-admission state (new session on top with its run spinner, prior rows and subtitles intact). live-sidebar-55s.mp4 |
fb841d3 to
0301f5d
Compare
|
Codex review: needs maintainer review before merge. Reviewed August 25, 2026, 6:04 PM ET / 22:04 UTC. ClawSweeper reviewWhat this changesThe branch prevents warm owner-first sidebar refreshes from publishing an owner-only roster over visible shared rows, and adds regression coverage for roster retention, DOM identity, and the Anthropic policy constant. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep this PR open: it is a concrete owner-boundary repair with focused regression coverage and credible live UI proof; it needs a rebase and exact-head CI completion before landing. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: FAIL (failed) — step 1 Assertions:
How this fits togetherThe Control UI turns Gateway session-list responses into the sidebar’s visible thread rows. Owner-first loading improves cold-start visibility, while shared responses and keyed rendering keep the established sidebar stable during refreshes and reorders. flowchart LR
Gateway[Gateway session responses] --> Refresh[Owner-first roster refresh]
Events[Session change events] --> Refresh
Refresh --> State[Sidebar session state]
State --> Renderer[Keyed sidebar renderer]
Renderer --> Rows[Visible session rows]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +10, Tests +336. Total +346 across 6 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the raw owner result within the refresh owner, preserve the silent warm provisional phase, then rebase and land only after the refreshed exact head proves the focused UI and compact CI lanes green. Do we have a high-confidence way to reproduce the issue? Yes: the checked-in mock-Gateway E2E defers the shared response after a session event and verifies the foreign row never disappears; the PR also supplies matching live Gateway evidence. Is this the best way to solve the issue? Yes: keeping the owner result inside the refresh owner removes the producer-side published-state dependency, rather than attempting a renderer-side guard after the roster has already been replaced. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against c3eca4f50813. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
0301f5d to
c9da371
Compare
|
Second main-CI heal carried in this PR — the 120s "timeout" class that has been failing Root cause: #129052 imported Timeline proof: no timeout signature on pre-#129052 bases; first hit 12:31 UTC (40 min after #129052 landed); still failing on bases containing #129387. Reproduction + fix proof (dist-less checkout, M-series): Follow-up worth owning separately: even the healthy baseline is a ~30s sync jiti compile of the |
d69d210 to
b35207a
Compare
The owner-first roster plan (#128767) published its provisional owner-only window as a full membership replacement on every primary refresh, so on multi-owner gateways every other user's sessions blinked out of the sidebar until the shared merge landed - up to once a second under event load. The provisional phase now publishes only when no roster is on screen (cold start keeps its fast first paint), and the shared phase merges the owner window from the initial load's returned rows instead of reading published state; the mergeExisting option is gone. A warm refresh whose shared phase fails now keeps the previous roster instead of collapsing to owner-only rows. The thread and child session lists also rendered rows positionally with map()+keyed(), so any reorder tore down and rebuilt every shifted row's DOM (spinners restarting, avatars remounting). Both now use repeat() with key identity, matching the catalog renderer. Regression coverage: owner-first-roster.test.ts pins the publish-sequence invariant and shared-failure retention (both fail pre-fix); the new browser test proves row DOM identity survives a reorder (fails on map()). The owner-first tests moved out of index.event-refresh.test.ts, which hit the max-lines limit.
Browser-level regression for the warm-refresh half of this fix: holds the shared phase deferred after a sessions.changed event and asserts the foreign-owned row never leaves the DOM. Fails on pre-fix code (the row count drops to zero the moment the provisional owner window publishes).
…onstant The provider-policy artifact keeps this id as a local literal so it never imports the provider-auth barrel (#129052 regressed dist-less CI checkouts into 120s jiti compiles of ~2.2k modules); this parity test stops the two constants from drifting apart.
b35207a to
142d143
Compare
|
Land-ready. Exact head Local commands: Regression proof: all three new tests fail on pre-fix code for the intended reasons (publish-sequence invariant, shared-failure retention, DOM identity under Known gaps: none blocking. ClawSweeper's review worker on this PR stalled at the placeholder (lease expired without publishing); no findings or rank-up moves exist to address, and a late re-review refreshes the rating post-merge per repo policy. |
|
Merged via squash.
|
…openclaw#129558) * fix(ui): stop warm sidebar refreshes from blanking foreign-owned rows The owner-first roster plan (openclaw#128767) published its provisional owner-only window as a full membership replacement on every primary refresh, so on multi-owner gateways every other user's sessions blinked out of the sidebar until the shared merge landed - up to once a second under event load. The provisional phase now publishes only when no roster is on screen (cold start keeps its fast first paint), and the shared phase merges the owner window from the initial load's returned rows instead of reading published state; the mergeExisting option is gone. A warm refresh whose shared phase fails now keeps the previous roster instead of collapsing to owner-only rows. The thread and child session lists also rendered rows positionally with map()+keyed(), so any reorder tore down and rebuilt every shifted row's DOM (spinners restarting, avatars remounting). Both now use repeat() with key identity, matching the catalog renderer. Regression coverage: owner-first-roster.test.ts pins the publish-sequence invariant and shared-failure retention (both fail pre-fix); the new browser test proves row DOM identity survives a reorder (fails on map()). The owner-first tests moved out of index.event-refresh.test.ts, which hit the max-lines limit. * test(ui): prove foreign-owned rows survive a warm owner-first refresh Browser-level regression for the warm-refresh half of this fix: holds the shared phase deferred after a sessions.changed event and asserts the foreign-owned row never leaves the DOM. Fails on pre-fix code (the row count drops to zero the moment the provisional owner window publishes). * test(anthropic): pin the local retired-profile id to the plugin-sdk constant The provider-policy artifact keeps this id as a local literal so it never imports the provider-auth barrel (openclaw#129052 regressed dist-less CI checkouts into 120s jiti compiles of ~2.2k modules); this parity test stops the two constants from drifting apart.




Related: #128767
Related: #129150
Related: #129517
What Problem This Solves
On multi-owner gateways (team.openclaw.ai), the sidebar Threads list visibly flickers: every other user's sessions blink out and reappear during normal use, up to roughly once per second under event load. Separately, any row reorder (a new session sorting to the top) rebuilds the DOM of every shifted row, restarting run spinners and remounting avatars.
Why This Change Was Made
The owner-first roster plan (#128767) runs on every primary refresh, including 200ms-debounced event refreshes, and its provisional owner-only phase published a full membership replacement. The PR correctly kept the provisional phase from advancing canonical membership, but it still replaced visible membership — on a warm screen that means all foreign-owned rows vanish until the shared merge lands. The structural cause: the shared phase found the owner rows by reading them back out of published state, so the owner phase had to publish to participate in the merge.
The redesign breaks that coupling in
session-roster-refresh.ts:load()returns its raw fetched result, the shared phase mergesappendSessionResults(ownerRows, shared)from the initial load's returned promise, and the provisional phase publishes only when no roster is on screen — cold start keeps the exact fast-first-paint behavior #128767 shipped for. ThemergeExistingoption is deleted. A warm refresh whose shared phase fails now keeps the previous roster instead of collapsing to owner-only rows.The render fix switches the thread and child session lists from positional
.map+keyed()(positional diffing tears down and recreates shifted rows) torepeat()with key identity, matching what the catalog renderer already does.This is complementary to #129150 (steady-state projection churn, landed) and #129517 (reconnect session-cache retention, open): three distinct mechanisms behind the same reported symptom, no shared production files.
User Impact
Operators on shared gateways no longer see other people's sessions blink out of the sidebar during normal event traffic, and rows keep their DOM (spinner phase, hover state, avatar) when the list reorders. Cold-start behavior is unchanged: your own sessions still paint first.
Evidence
ui/src/lib/sessions/owner-first-roster.test.ts— publish-sequence invariant (no published state during a warm refresh may drop a foreign-owned row) and shared-failure roster retention. Both fail on pre-fix code for the intended reasons (verified by revertingsession-roster-refresh.tsto HEAD and rerunning).ui/src/components/app-sidebar-row-identity.browser.test.ts— real-Chromium proof that row DOM identity survives a reorder. Fails on the pre-fix.maprendering (element rebuilt), passes withrepeat().ui/src/e2e/session-owner-first.e2e.test.tspasses unchanged (owner rows still paint before the shared roster on first load).node scripts/run-vitest.mjs ui/src/lib/sessions ui/src/components/app-sidebar.test.ts ui/src/components/app-sidebar-session-projection.test.ts).pnpm check:changedgreen (format, tsgo core+UI, oxlint, guards). The owner-first tests moved out ofindex.event-refresh.test.tsbecause it crossed the max-lines limit — split per policy, no suppression.gpt-5.6-sol, high): clean, no findings, "patch is correct (0.98)".repeat()call shape, return-value signature) against one deleted concept (mergeExisting); tests +290.