Repository navigation
feat(ui): load owner sessions before shared roster - #128767
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs changes before merge. Reviewed August 24, 2026, 11:40 AM ET / 15:40 UTC. ClawSweeper reviewWhat this changesThis PR changes the Control UI session sidebar to show the signed-in operator’s sessions before merging the shared roster. Merge readiness⛔ Blocked by patch quality or review findings - 5 items remain Keep open: both prior P1 blockers remain on the exact reviewed head. Late presence identity never triggers an owner-first refresh, and event refresh drops appended shared-session pages. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: FAIL (partial) — step 2 Assertions:
How this fits togetherThe Control UI receives a Gateway connection snapshot and session events, then refreshes the sidebar’s canonical session roster. The new plan makes an owner-scoped request visible before a shared request is merged into that roster. flowchart LR
Gateway[Gateway session service] --> Snapshot[Connection and presence snapshot]
Snapshot --> Refresh[Session roster refresh]
Refresh --> Owner[Owner-scoped request]
Owner --> Sidebar[Provisional sidebar roster]
Refresh --> Shared[Shared roster request]
Shared --> Merge[Deduplicated canonical roster]
Merge --> Sidebar
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +43, Tests +310. Total +353 across 6 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Keep one canonical owner-first refresh plan, trigger it when identity becomes available, and retain the shared global pagination window independently from the owner-expanded visible count. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: a same-client null-to-present selfUser update is explicitly modeled in the hydration test, and owner-first pagination loss follows the retained-options and fixed-limit path. Is this the best way to solve the issue? No. The two-phase refresh belongs in the roster owner, but it must react to the identity transition and keep shared-page state separate from the merged visible row count. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a23e77b61afe. LabelsLabel justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Co-authored-by: VACInc <[email protected]>
Co-authored-by: VACInc <[email protected]>
3c62513 to
cb08717
Compare
|
Implemented and verified the two ClawSweeper rank-up moves on exact head Review fixes
Both regressions failed on the previous head for the intended reason and pass on this head. Visible proofThe first inspected capture shows only the owner roster while the shared Owner roster published first Shared roster merged afterward Validation
Production LOC: +73/-13 (net +60) for the owner-first capability and its late-identity/pagination ownership; tests/E2E: +332/-9 (net +323). Final landing gate
|
|
Merged via squash.
|
* feat(ui): load owner sessions before shared roster Co-authored-by: VACInc <[email protected]> * fix(ui): preserve owner roster across refreshes Co-authored-by: VACInc <[email protected]> --------- Co-authored-by: roboclaw-bot <[email protected]> Co-authored-by: VACInc <[email protected]>
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.
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.
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.
…#129558) * fix(ui): stop warm sidebar refreshes from blanking foreign-owned rows 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. * 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 (#129052 regressed dist-less CI checkouts into 120s jiti compiles of ~2.2k modules); this parity test stops the two constants from drifting apart.
…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: #122865
Related: #126701
What Problem This Solves
On shared Control UI gateways, the global newest-session window can crowd the signed-in operator's older active sessions out of the sidebar. Operators then see other people's recent work while their own still-active sessions appear to be missing.
Why This Change Was Made
The canonical session refresh owner now runs one atomic two-phase plan for the default active roster: request and publish the signed-in owner's latest 60 sessions first, then request the latest 60 shared sessions in the background and merge them by session key. The provisional owner phase does not advance canonical membership or durable query options, so reconnects retain an already-visible foreign-owned route and later event/mutation refreshes replay the same owner-first policy.
This reuses the existing Gateway
ownerIdfilter and serialized refresh queue. It adds no polling, protocol, config, or storage surface. Explicit owner, involving-me, search, archive, and pagination queries remain single-phase. The shared response owns the global pagination cursor, keeping this orthogonal to the global-pagination repair in #126708.User Impact
The signed-in operator sees up to 60 of their sessions as soon as the first bounded request completes. Shared sessions then appear without blocking that first useful roster. The combined list is deduplicated and can contain up to 120 rows before normal pagination continues.
Evidence
Regression proof failed on pre-fix
main: the connection sent one unfilteredlimit: 50request instead of an owner-scopedlimit: 60request.Focused verification on rebased head:
node scripts/run-vitest.mjs ui/src/lib/sessions/connection-hydration.test.ts ui/src/lib/sessions/index.event-refresh.test.ts ui/src/lib/sessions/list-options.test.ts ui/src/lib/sessions/index.test.ts ui/src/lib/sessions/index-list.test.ts --run --testTimeout 5000— 103 passed.node scripts/run-vitest.mjs ui/src/e2e/session-owner-first.e2e.test.ts --run --testTimeout 30000— mocked-Gateway browser proof passed. It holds the shared response open, observes the owner roster, then releases and verifies the merged roster.pnpm check:changed— passed formatting, dead-export scan, i18n, core/UI typechecks, and lint..agents/skills/autoreview/scripts/autoreview --mode uncommitted— clean; patch correct 0.99, no accepted/actionable findings.Live Roboclaw store benchmark that informed the staged limit (six balanced warm samples with titles/previews):
The browser proof captures the initial owner-only roster and the later shared merge. Production delta is +52/-9 (+43 net); test/E2E delta is +312/-2 (+310 net). The production growth is the atomic two-phase ownership boundary and provisional/canonical distinction; existing request, merge, event, and pagination owners are reused.