Skip to content

perf(control-ui): send sidebar session row deltas - #172946

Merged
steipete merged 7 commits into
mainfrom
steipete/coldload-sessions-list-delta
Oct 15, 2026
Merged

steipete merged 7 commits into
mainfrom
steipete/coldload-sessions-list-delta

Conversation

@steipete

@steipete steipete commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

A signed-in reload of a dashboard deep link can keep receiving two large sidebar windows after boot. The campaign's October 15 census recorded roughly 325 KB and 151 KB responses near 9 s and 15 s, despite conditional row revisions. A single changed row invalidates the complete-vector revision.

The source trace explains the pair: unsafe membership events invalidate both the canonical owner-first window and the observed involving-me window. Their independent coordinators collect for 4–5 seconds and enforce a minimum 5-second cooldown. Unknown recent sessions, ownership/involvement changes, removals and broad sharing notices require authoritative selection; bounded event snapshots cannot always prove membership or refill a window. These are event-driven reads, not unconditional polling.

This change cuts recurring bytes substantially. It does not demonstrate a material reduction in total response-task time.

Complete source trigger audit (checked through main 801d463)

Request and lifecycle entry points

Paths are relative to ui/src/. “Pair” means capable of refreshing both canonical primary and an observed filtered sidebar window; it does not imply every invocation does so.

Producer Exact condition Request/ownership and pacing Source
Wire request A primary load, managed refresh, or scoped list read reaches requestSessionListParams; connected scope remains current All use one client.request("sessions.list", …). Sidebar requests reuse raw per-client/per-query ifRowsRevision; unchanged response reuses raw rows. No timer here. lib/sessions/session-requests.ts:168-222
Managed pagination pageSize and requested limit greater than pageSize, current scope, previous page hasMore and nonempty rows Sequential page requests with advancing nextOffset; replacement uses retained window size. Ordinary big sidebar queries do not set pageSize. session-requests.ts:223-258; session-managed-list-refresh.ts:164-182
Initial connection/reconnect Connected client differs from hydratedClient Subscribe events, background primary bootstrap with previous filters/selected agent, then refresh observed managed windows whose connectionEpoch differs. Pair possible. lib/sessions/index.ts:495-526; session-roster-refresh.ts:585-604
Viewer identity change on same connected client hydratedSelfUserId differs, hydrateConnection false Unscoped scheduleEvent: primary plus managed invalidation, paced. index.ts:495-506
Agent selection Nonempty nextAgentId and current client has been hydrated Retire previous presentation; refreshSelection reuses latest selected agent; foreground intent bypasses background admission. index.ts:530-537; session-roster-refresh.ts:605-626
Gateway availability returns without connection replacement available && !previousAvailable && !connectionChanged Invalidate managed windows. Primary bootstrap/reconnect ownership is separate. session-roster-refresh.ts:530-535
Remote config change event.event === config.changed Clear descriptions, scheduleEvent without scope: primary plus managed windows; paced. index.ts:551-557
Remote sessions.changed Any reason except activity-summary; matching agent/parent; row cannot certify held membership Capture primary and managed admission before reconciliation, then schedule unsafe windows together. reason:create expedites; other reasons paced. index.ts:559-631; session-list-query.ts:36-274
Remote session.message Effective hasActiveRun === false OR defined effective status != running Same admission/scheduling as sessions.changed. Nonterminal messages deliver row/message observers and return without list scheduling. index.ts:584-588,617-630
Groups notice sessions.changed reason groups Invalidate/load group metadata; normal list admission still applies (keyless/missing session becomes broad invalidation). index.ts:613-615
Failed/uncertain list Matching window has error, cached-only primary, missing result, or wrong connectionEpoch Next matching event cannot skip authority; ordinary refresh path is paced. DB-inspection-pending schedules owner-provided retry delay. session-roster-refresh.ts:646-658,295-321; session-list-query.ts:470-492; session-managed-list-refresh.ts:290-313
Event overlaps list read A row observed after issuedRevision is missing from accepted response, missing from reconciled result, or crosses owner-first shared boundary Schedule one trailing authoritative read; accepted row facts otherwise merge without trailing read. session-list-query.ts:496-525; session-roster-refresh.ts:249-259; session-managed-list-refresh.ts:223-234
Healthy applied events Snapshot safely applied and window remains observed Schedule one fallback at >=60 s, then normal coordinator admission; authoritative replacement absorbs older fallback. This cannot explain the 5-second pair. event-refresh-coordinator.ts:87-93; session-roster-refresh.ts:679-702
Hidden/pagehide document becomes hidden or pagehide; timer/inflight work or markDirty Stop timers, retain queued invalidation; no automatic read while hidden. Visibility/pageshow reactivates and arms catch-up without collection delay, respecting pending/cooldown. session-roster-refresh.ts:494-516; event-refresh-coordinator.ts:109-120; session-managed-list-refresh.ts:353-363
Explicit refresh/replacement/filter Connected scope; explicit API not satisfied by held result with no overrides/force Bypasses event cooldown, absorbs old pending invalidation. Primary coalesces while pending; managed retains one replacement. session-roster-refresh.ts:407-468; session-managed-list-refresh.ts:119-162
Accepted local creation Current confirmed creation; owning agent matched Membership reconciliation invalidates observed managed queries immediately and reconciles canonical list independently of primary bootstrap. Remote create also expedites. lib/sessions/session-mutations.ts:119; session-roster-mutation-refresh.ts:26-57; session-roster-refresh.ts:106-151
Confirmed local mutations/deletions Successful current mutation requiring membership reconciliation; original agent(s), not current UI selection reconcileMutation invalidates matching managed windows and reads canonical/current or original agent; accepted deletion batch invokes once per effective scope. Details below. session-roster-mutation-refresh.ts:26-57; session-deletions.ts:270
Controller capability replacement sessions capability source changed, connected, sidebar has status/owner/involving filter Bind filtered subscription, schedule background forced filtered refresh. components/session-data-controller.ts:481-498
Controller Gateway source/client/connection change Connected + sessionsSource + filtered sidebar, after source/client/connected change Background filtered refresh, scoped through current subscription/bootstrap. Presence-only updates do not take this branch. session-data-controller.ts:500-551
Controller agent scope change Previous selected agent non-null, new agent differs and query has agentId; connected + filtered Immediate for foreground selection intent, otherwise background refresh. Cross-agent ownerId query is not re-read solely for selected-agent change. session-data-controller.ts:342-403
Owner/Involving me filter First initialization or effective ownerId/involvingMe/GatewayURL+viewer scope changes Retire/reset prior list. Explicit intent refreshes immediately; automatic restore schedules background refresh. components/session-owner-filter-controller.ts:52-80
Owner facet clears stale selected owner No pending refresh; successful nonloading facet; selected owner is nonself and absent from complete owners facet Automatically set All owners; same filter-change path. session-owner-filter-controller.ts:83-99
Status filter Actual status value changes Reset selection/list and force sidebar refresh. components/session-organizer-controller.ts:769-777
Load more !loading, hasMore, numeric cursor, same still-current query agent Append one page; no request when terminal/mismatched affected agent. session-data-controller-events.ts:195-229; session-data-controller.ts:607-608
Catalog import completion Successful current sessions.catalog.import, generation and mutation scope still current Explicit affected-agent refreshSidebarSessions. components/session-data-controller-catalog.ts:551-580
Local involvingMe hide/unhide Successful setInvolvement for current mutation scope Apply local hidden receipt, then explicit sidebar refresh once. components/session-organizer-batch-mutations.ts:229-257
Local organizer patch Successful current patch, status filter is non-active, deferListRefresh false Explicit sidebar refresh; active view relies on capability reconciliation. components/session-organizer-patch.runtime.ts:52-91
Local organizer delete Successful current delete/deleteMany, status filter non-active Explicit sidebar refresh; capability deletion owner separately reconciles canonical/matching managed lists. components/session-organizer-operations.runtime.ts:125-138,539-568
Deferred organizer batch Accepted batch completion, effective owning agents known Reconcile each agent once; additionally refresh sidebar for non-active status. components/session-organizer-batch-mutations.ts:81-114
Archive undo Current accepted undo operation after restoring rows sessions.invalidate + refreshReplacement, canonical authority; managed invalidation follows capability. components/session-organizer-archive.runtime.ts:354-367

Event admission: exact conditions that retain authority

The primary uses canApplyPrimarySnapshot, requiring live/non-error/non-cached state. Managed windows use the same canApplySessionListSnapshot, additionally requiring current connectionEpoch and no error. All references here are lib/sessions/session-list-query.ts.

Condition Effect
No result, unparseable event, unsupported base query such as search/activeMinutes/unsupported server filters Authoritative refresh (:44-67). The normalization fixes enrichment/global/archive flags and removes owner/involving/board/child/count flags only to test the supported base contract; their own membership checks below still run.
Missing full event.session, catalogChanged true, phase reset, positive offset Authoritative refresh (:70-76).
Uncovered/missing parent or incomplete required ancestor coverage Authoritative refresh (:125-145). ancestorSessionRefs must resolve against admitted held content revisions through row reconciliation.
Certified excluded subagent/kind/dock/archive/board/child ownership/hidden involvingMe row Safe exclusion, no immediate refresh (:146-174).
Previously unheld row below a full recency window, with at least windowSize retained rows ahead; not viewer-owned owner-first overflow Safe exclusion, no immediate refresh (:176-195). Old fixture row240 always qualified.
New/recent unheld row not certified excluded, including cron/other-user/subagent rows entering the window Authoritative refresh (:201-202). Event snapshots cannot create filtered membership. Both lists can invalidate even if involvingMe later excludes that row.
Existing row missing admitted successor, generation/sessionId or kind changes Authoritative refresh (:201-206).
Archive, pin, pinnedAt, owner, createdActor, spawnedBy, controlOwnerSessionKey, parentSessionKey, sidebarRoot changes Authoritative refresh (:207-216).
Involving me row lacks viewer identity, explicit hidden:false in admitted row and event source, or current viewer owner/participant receipt Authoritative refresh (:217-227). Bounded participant omission cannot certify nonmembership.
Owner-count query changes run/status/visibility/sharing/category/classification/system-label facts Authoritative count refresh (:228-242); separate compact query.
Child/board membership no longer certified Authoritative refresh (:243-249).
Missing/backward updatedAt, older snapshotAt, activity sort moves backward Authoritative refresh (:255-263).
Owner-first retained overflow row crosses into shared page Authoritative refresh (:265-291).
Otherwise stable member, current generation, complete relevant coverage, forward recency Apply row locally; retain minute safety fallback.

Similar clocks that do not request the root pair

Owner Actual operation and condition
Catalog host event Applies progressively delivered catalog rows locally; no root sessions.list (session-data-controller-catalog.ts:266-284).
Catalog changed/visibility/retry Schedules sessions.catalog.list, limitPerHost40; safety 10min with advertised changed events, otherwise30s. Does not request root pair (catalog.ts:211-229,254-260; app-sidebar-session-catalog-live.ts:380,419-428).
Catalog continued browser event Bind adopted row and clear discovery pages, no list read (catalog.ts:286-298).
Lineage retry Failed lineage lookup retries after5s, using up to16 sessions.describe calls, not sessions.list (session-lineage-controller.ts:378-499; app-sidebar-child-session-data.ts:61-130).
Expanded child Observe/refresh spawnedBy window, default limit100, not root sidebar pair (session-data-controller.ts:628-679; lib/sessions/child-session-data.ts:10-18).
Pins Once per key/connection sessions.describe background admission, not sessions.list (app-sidebar-personal-navigation.ts:90-209).
People directory/presence Directory/hover only; opened person activity card observes source activity, compact rows, limit200 (sidebar-people.runtime.ts:228; person-activity-data.ts:61-88).
Owner counts Separate source sidebar, compact, includeOwnerSessionCounts true, limit1 query; initial observation or explicit button, plus capability invalidation (sidebar-owner-session-counts.ts:7-20,81-101; app-sidebar-online.tsx:268).
Online/grouped agent roster Separate source agent-roster, compact, limit300/pageSize50, archived all, optional involvingMe; first visible subscriber/connection/filter/manual refresh (lib/agents/roster-activity-store.ts:109,168-181,204-245).
Pages view Dashboard-mode query on first Pages activation; loadMore only when hasMore/notloading (sidebar-navigation-catalog.ts:50-80).
Agent/chat/presence frames Agent/chat update visual run state; presence updates display/people/counts. No direct root-list invalidation (lib/sessions/index.ts:541-545; session-data-controller-events.ts:239-256).
chat.metadata.changed / activity-summary Description invalidation or observer delivery only; no direct root-list scheduling (index.ts:551-553,569-571).

Additional capability callers and Gateway producers

Path Exact condition and effect
Capability patch Successful current sessions.patch reconciles membership unless deferListRefresh or a confirmed patch containing only unread:false. Category (+ optional pinned) uses background category reconciliation; uncertain category transport also reconciles. session-mutations.ts:305-438.
Capability patchMany/reset/assignOwner patchMany applies confirmed local fields; reset performs the RPC; assignOwner applies a target-fenced local owner patch. None directly reads lists; caller/event paths own authority. session-mutations.ts:448-551.
Recovery/branch mutations Current successful recover notifies creation and reconciles agent membership. Current successful rewind/fork/switchBranch best-effort reconciles the original agent. Compact/files/subscriptions/listBranches do not read root lists. session-scoped-operations.ts:49-61,159-208.
Group mutations Current successful groupsRename/groupsDelete calls refreshRows (primary force refresh); groupsPut/groupsUpdate do not. session-group-catalog.ts:276-291; index.ts:293.
Previous connection confirmation Reconcile an accepted old-epoch mutation only if the original capture exists and client identity remains the same. session-mutation-refresh.ts:24-53.
Deletion failure/remote removal Rejected or uncertain optimistic rollback invalidates all; remote delete lacking generation/sessionId invalidates all. Accepted delete batch reconciles once per effective scope. session-deletions.ts:151-167,268-274,387-391.
Row reconciliation Accepted changed rows invalidate matching managed lists, except a supplied source-list scope already covered by a newer authoritative read. Run-terminal reconciliation invalidates managed lists for terminal keys while applying primary facts locally. session-reconciliation.ts:272-288; index.ts:415-433.
List capability methods subscribeList observes without initial RPC; observeList subscribes then calls refresh. Explicit refreshList nonprimary reads its managed owner; primary reads unless unforced/no overrides/held result. Managed automatic refresh requires current entry, pageActive and listeners; explicit refresh bypasses those automatic gates. session-primary-windows.ts:46-84,124-138; session-roster-refresh.ts:568-594; session-managed-list-refresh.ts:342-363.
Plugin refresh/deferred patch Plugin sessions.refresh calls refreshReplacement; successful deferred plugin patch calls it after confirmation. ui/src/plugins/control-ui-host.ts:155-159,207-224.
Placement recovery Recovery finally invalidates only while current and not cancelled. session-placement-startup.runtime.ts:253-256.
Chat refresh callers Primary refresh after selected-session terminal reconciliation fails; selected-agent change; queued chat returns to active presented pane; matching tool result with details.changedModel true. chat-state-events.ts:181-211; chat-state-refresh.ts:109-123; retained-presentation.ts:479-489; tool-stream.ts:98-109. These calls alone do not force the managed pair.
Observer outage recovery Error becomes null: refresh primary and invalidate managed windows. session-roster-refresh.ts:223-231.
Gateway sharing producer Emits keyed reason:sharing followed by broad keyless/agentless reason:sharing so revoked recipients can drop inaccessible rows. Broad notice necessarily invalidates both windows. src/gateway/server-methods/sessions-sharing.ts:158-165.
Gateway owner producer Accepted assignment emits keyed reason:owner; changed owner cannot apply to held membership/order locally. src/gateway/server-methods/sessions-mutations.ts:499-504.
Snapshot preparation failure Emits broad reason:update (optionally agent-scoped), no session or key; authority required. Deleted generation deliberately carries no current row. src/gateway/server-methods/session-change-event.ts:150-199.
Run creation/coalescing Visible newly created resolved session emits create, followed by send/run-start; coalescing can replace create with a later reason while preserving catalogChanged. agent-run-execution-phase.ts:318-337,586-595; session-change-event.ts:399-420.
Model/runtime patch Sets catalogChanged, disabling local list snapshot admission. sessions-patch-effects.ts:50-60.

Involving-me removal is not derivable from participant omission: Gateway row participants are bounded to four (expanded to 32), whereas its authoritative membership index also includes mentions and explicit involvement states (session-utils-row.ts:374-393; session-row-selection.ts:91-119). This is a concrete reason to retain authority for those triggers.

Change

Keep authoritative refreshes and extend the existing bounded Gateway presentation owner with one previous immutable vector. Clients opt in through the existing ifRowsRevision string, using delta:<revision>. A retained exact base permits changed/inserted rows plus complete positional order; omitted base positions leave the window. Positional references also preserve duplicate raw session keys across agents.

Current authorization and selection precede encoding. The UI expands response-local facts and reconstructs the full raw window in its existing request cache before capability reconciliation. Counts, facets, defaults and pagination remain current. There is no second list cache, configuration option, protocol version change or durable-state change.

Bare revisions retain full/unchanged behavior. Older Gateways treat the prefixed token as a miss and return full rows. Missing/retired history and broad projection resets also fall back to full rows.

Evidence

Head: 1ac2817c850e92cb55c34e3c5d0ce384088f6e62. Seven interleaved full/delta pairs on one quiet AWS c7a.4xlarge lease (cbx_41da50e8b73e, 16 vCPUs, AMD EPYC 9R14, about 30 GiB usable RAM), using the repository's headless Chromium. The pre-comparison interval was 100% idle with no swap or steal.

The Team-scale fixture has 300 sessions, 120 people, 30 pins and 12 inline widgets. Its 125 mixed events over 20 seconds include authoritative inventory mutations before publishing new cron/subagent/other-user sessions, window entry/exit, owner/involvement, archive/delete and sharing events. Each capture includes a further 16-second drain. Delivery injection is 35 ms with a 4 ms frame gap. Every run reproduced three sustained conditional request pairs after six seconds, matching request starts within 2.5 seconds (half the minimum cooldown).

Both modes use the same final client bundle and production row packer; availability of the prior vector selects full versus delta responses. This isolates the wire-format effect. It does not measure real Gateway selection/projection CPU or production history-hit frequency. Fixture rows are smaller than the census rows; these are fixture byte measurements.

Metrics cover the 36-second post-boot live phase. Per-refresh values are medians of seven per-run medians; capture totals are medians of seven run totals. Brackets give Q1–Q3. Per-refresh rows, bytes and task times cover conditional replies with changed or removed rows. Capture totals include every reply, including the first primary cache miss and unchanged trailing reads. KB means 1,000 bytes.

Metric Full response control Delta response
Owner-first changed/inserted rows per refresh 6 [6–7] 6 [6–7]
Owner-first rows sent per refresh 203 [203–203] 6 [6–7]
Owner-first wire KB per refresh 95.26 [95.26–95.29] 9.66 [9.66–10.26]
Owner-first response task ms per refresh 9.25 [9.22–9.31] 8.62 [8.43–8.88]
Involving-me changed/inserted rows per refresh 6.0 [5.75–6.0] 5.5 [5.5–5.75]
Involving-me rows sent per refresh 200 [200–200] 5.5 [5.5–5.75]
Involving-me wire KB per refresh 93.45 [93.44–93.45] 9.30 [9.22–9.48]
Involving-me response task ms per refresh 8.51 [8.17–9.18] 8.26 [8.03–8.73]
Both windows: wire KB per complete capture 759.15 [754.75–759.31] 167.05 [167.04–167.76]
Both windows: sum of response-containing task ms per capture 79.32 [73.30–98.92] 79.09 [77.42–94.85]

Changed-window replies are about 90% smaller; total sidebar wire bytes fall 78%. Total response-task time is effectively flat. This is a bandwidth improvement; the remaining client projection/reconciliation work still needs separate attribution.

Refresh counts do not fall. Owner-first has 4 [4–4] reads per capture in both modes; involving-me has 5 [4–5] versus 5 [5–5]. Normalized to the 20-second active stream, these are 12 [12–12] and 15 [12–15] versus 12 [12–12] and 15 [15–15] reads/minute. These are short-stream normalizations, not observed continuous-minute rates. Across the complete 36-second captures, median rates are approximately 6.66 and 8.33 reads/minute in both modes. Median request intervals remain about 5.1–5.2 seconds; unchanged trailing replies account for the boundary variation.

The timing metric is the instrumented renderer task containing application JSON parse and reconciliation microtasks. Common probe hooks are included; later animation-frame rendering and Node IPC are excluded. It is not an isolated JSON-parser measurement.

Quiet AWS run and proof logs.

Synthetic final-state screenshots

Both captures use the same final client build and synthetic data. The control receives full windows; the candidate receives deltas. No visual design change is intended.

Full response control

Delta response

Validation

Independent review is clean through P2. Final-head core, UI, benchmark and affected UI-test typechecks pass, as do focused lint/format checks and the Node-to-Chromium serialization smoke.

All 86 tests across seven focused files pass on the same AWS lease. New/changed test-file wall times, each run with pnpm test <file> --maxWorkers=1:

File Tests Wall time
src/gateway/session-list-delta.test.ts 2 44.67 s
ui/src/lib/sessions/session-list-enrichment.test.ts 11 4.32 s
ui/src/lib/sessions/session-roster-refresh.test.ts 30 3.29 s
ui/src/lib/sessions/sidebar-list-churn.test.ts 1 4.49 s
ui/src/test-helpers/control-ui-cold-load-probes.browser.test.ts 1 3.64 s

The Gateway file includes cold shared-worker compilation; its integration case takes 2.50 seconds. It exercises the actual list handler with one synthetic state fixture. Tests cover insert/remove/refill/reorder, revision misses, limits/pages, owner and involving-me filters, disclosure revocation, reset fallback, response-local facts, overlapping reads and older-server responses. Related serialization (9 tests, 21.40 s) and event-refresh (32 tests, 10.82 s) files also pass.

Exact-head CI: run 38735589749 is complete. All four selected UI e2e shards, production/test typechecks, lint, protocol, performance and other checks pass. checks-ui (2/3) fails only web-awesome-theme.browser.test.tsx:207: expected rgb(139, 139, 148), received oklab(0.677847 0.00159857 -0.00533658). The same file, line and exact expected/received values fail on pre-fix main ad95e29cdac0 when replaying the recorded CI inventory, Bun runtime, shard and worker count: 616 files pass, one fails; 6,832 tests pass, one fails, three skip (162.05 s wall). This is an inherited failure; no CI rerun has been requested.

Full UI e2e on the final head: all 801 files ran: 794 passed, 6 failed, 1 skipped; 3,492 tests: 3,483 passed, 4 failed, 5 skipped, in 6,638.87 s. The complete verbose pass/fail inventory is retained with the AWS run linked above.

Failed file in the complete run Result and follow-up
ui/src/e2e/browser-talk-start-stop.e2e.test.ts Stale close-payload expectation omits disposition: "abort". Same assertion reproduces on pre-fix main at line 998, 9 passed / 1 failed (54.02 s wall).
ui/src/e2e/chat-video-compression.e2e.test.ts Strict text locator matches both the inline status and the general error alert. Same two-match failure reproduces on pre-fix main at line 127, 2 passed / 1 failed (27.45 s wall).
ui/src/e2e/initial-connect-splash.e2e.test.ts Asynchronous heading measurements encounter a null bounding box at line 457. The same failure reproduces on pre-fix main, 12 passed / 1 failed (61.87 s wall). A candidate whole-file replay also passed all 13 tests, confirming intermittency rather than a candidate fix.
extensions/qa-lab/src/control-ui-automation-management.real-gateway.e2e.test.ts Lease checkout/lease-root ancestors were group-writable. Removing group-write permission from the owned directories, with artifacts kept inside the repo and the private-file guard unchanged, gives 2/2 passing on the same head (365.15 s wall).
ui/src/pages/workboard/workboard-native-bundle.e2e.test.ts Missing WebKit prerequisite; installing the repository's browser gives 2/2 passing on the same head (38.56 s wall).
ui/src/e2e/tooltip-first-activation.e2e.test.ts Same prerequisite; 2/2 passing after installation (28.22 s wall).

The prerequisite replays use the same candidate lease: WebKit replay and final export scan, private artifact replay. An intermediate attempt placed artifacts outside the repository, which the QA fixture rejects; that failed setup attempt is excluded from product conclusions.

Pre-fix-main comparison, pinned to ad95e29cdac09d711f5fd1ff3be44a13b4055a5e, uses a fresh c7a.4xlarge lease (cbx_90cc81b43219). The QA automation file also passes both cases on that baseline (372.37 s wall) with the private artifact setup. Main independently repaired the unrelated browser fixtures in 354f067a3638 (idle/hover theme assertions), 9e3514ae247c (video status/alert assertions) and c476ce6d18cc (Talk abort expectations and atomic splash measurements). The candidate was not rebased or rerun in CI to chase those unrelated failures.

The earlier broad changed-file check passed production types, formatting, line caps, lint and other static guards; its mock typing failure was corrected and the affected graph now passes. The final export scan reports ten exports in untouched files (112.04 s). The pinned main scan also fails (108.65 s): five findings match exactly (assertRecord, createAgentFixture, classifyUnitFastTestFileContent, QuestionPanelQuestion, recommendedIconUrl). Main has independently removed the other five exports or their re-exports: ReadToolContinuationSchema, authorizeSessionSharingTarget, FollowupQueueDisposition, DoctorLintCliOptionsSchema, and renderMessageGroupContent. None of these files is changed by this PR; no new unused export is introduced by the delta path.

The accepted comparison/full-suite command completed and its complete logs, 14 raw traces and 112 MB artifact archive were retained locally. Crabbox's terminal-receipt publication returned HTTP 502; a later receipt lookup still has no committed terminal record. The follow-up runs have normal terminal receipts. The terminal receipt remains unavailable; the raw artifacts and complete command logs remain available.

Production LOC command requested by the campaign:

git diff --stat origin/main...HEAD -- ':!*.test.ts' ':!*test-support*' ':!docs/*'

Result: +928 / -117 = +811 net across 12 files. This includes +60 runtime lines and +751 measurement-harness lines. Runtime growth is required by the optional delta contract and retained full-response compatibility/fallback. The harness growth supplies changing authoritative inventory, paired-refetch verification and response-task attribution; superseded serialization and event-scheduling paths were removed during extraction.

All lane-owned AWS leases were released after artifact collection; no local Gateway was started. Remaining measurement limits are production delta-history hit frequency and real Gateway projection CPU, neither claimed by this PR.

@clawsweeper

clawsweeper Bot commented Oct 15, 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: L labels Oct 15, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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. labels Oct 15, 2026
@clawsweeper

clawsweeper Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR adds optional membership churn and response tracing to the Team-scale Control UI benchmark.

Example: A signed-in dashboard receives ownership and membership changes across two 200-row sidebar windows.

  • Before: The held-row-only workload misses the invalidations that trigger paired list refreshes.
  • After: The synthetic inventory changes before events arrive, allowing the benchmark to observe paired refreshes and record their transfer and response work.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful, focused investigation with a reported capability-level reproduction, but the wire measurement defect limits its conclusions.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored diagnostic adds no application runtime behavior; its supplied result exercises the session capability through an in-process harness, and browser measurements are explicitly pending.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Product

Kind: Test only · Worth it: Yes
User problem: Busy dashboards can still transfer paired full sidebar windows when events cannot certify membership.
Reason: The maintainer-authored experiment investigates a concrete remaining workload without prematurely changing the product contract.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep this maintainer-owned experiment open under its explicit do-not-merge direction; correct the sidebar response measurement defect before drawing performance conclusions.

Priority: P3
Reviewed head: 918f03fab997f5760b432dc5ecb4b38ff2b5e9eb

Before merge

  • Project sidebar fields before packing benchmark responses (P2) - With --sidebar-list-churn --live-events, this call receives raw fixture rows containing model, modelProvider, contextTokens, and totalTokens. shareSidebarSessionRows only factors fields into sharedFacts; it does not apply the sidebar projection. Production removes these fields using SESSION_SIDEBAR_ROW_FIELDS and sets rowMode="sidebar" in session-row-presentation.ts before packing. Consequently the new benchmark sends extra token/model data and omits the projection marker, distorting the transfer and client reconciliation measurements that this experiment is intended to establish. Apply the production sidebar field contract before packing, while preserving stable identities for unchanged projected rows.

Findings

  • [P2] Project sidebar fields before packing benchmark responses — scripts/bench-control-ui-cold-load.ts:179-182

Tests

  • Missing end-to-end proof: The planned browser pilot has not yet supplied traces showing paired refreshes, production-shaped response bytes, and response-task measurements; this diagnostic makes no fail-before/pass-after fix claim.
Agent review details

How this fits together

The benchmark loads production Control UI assets against a synthetic Gateway, feeds session events into the real list owners, and records browser traces and response statistics.

flowchart LR
  A[Synthetic session inventory] --> B[Mock Gateway list responses]
  C[Membership churn events] --> A
  C --> D[Control UI list owners]
  D --> B
  B --> D
  D --> E[Browser response probes]
  E --> F[Benchmark artifacts]
Loading

Technical review

Best possible solution:

Make the synthetic sidebar responses match production projection, then use the experiment’s measurements to guide any separate runtime optimization.

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

Source confirms that uncertain membership can invalidate both independently paced windows; the added diagnostic exercises that path, but no target code was executed during this review.

Is this the best way to solve the issue?

Extending the existing benchmark is appropriate for this investigation, provided its synthetic wire responses honor the production sidebar projection.

Full review comments:

  • [P2] Project sidebar fields before packing benchmark responses — scripts/bench-control-ui-cold-load.ts:179-182
    With --sidebar-list-churn --live-events, this call receives raw fixture rows containing model, modelProvider, contextTokens, and totalTokens. shareSidebarSessionRows only factors fields into sharedFacts; it does not apply the sidebar projection. Production removes these fields using SESSION_SIDEBAR_ROW_FIELDS and sets rowMode="sidebar" in session-row-presentation.ts before packing. Consequently the new benchmark sends extra token/model data and omits the projection marker, distorting the transfer and client reconciliation measurements that this experiment is intended to establish. Apply the production sidebar field contract before packing, while preserving stable identities for unchanged projected rows.
    Confidence: 0.98

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Maintainer experiment and explicit pause: The complete live PR body identifies this as an experiment, says do not merge, and leaves browser measurements pending; the draft head remains 918f03f. The supplied body identity is 9604ef1f50488f4dc42d858db589d5ed929992837d531999df5fa4408d898013. (918f03fab997)
  • Introduced scope: The pinned introduction diff changes benchmark, probe, fixture, and diagnostic test code without changing application runtime behavior. (scripts/bench-control-ui-cold-load.ts:172, 918f03fab997)
  • Current-main refresh contract: Current main independently schedules primary and managed list refreshes for uncertain membership, while applied snapshots retain a safety fallback; the coordinator supplies four-to-five-second collection and at least five-second cooldown. (ui/src/lib/sessions/session-roster-refresh.ts:656, f41b2b656be5)
  • Production sidebar projection: Production deletes fields outside SESSION_SIDEBAR_ROW_FIELDS and sets rowMode before packing; the new benchmark instead packs fixture rows containing model, modelProvider, contextTokens, and totalTokens directly. (src/gateway/session-row-presentation.ts:523, 918f03fab997)
  • Feature ownership history: Merged history consistently routes the benchmark and recent sidebar refresh work to Peter Steinberger, including the initial Team-scale benchmark and subsequent refresh and probe changes. (scripts/bench-control-ui-cold-load.ts:1, f41b2b656be5)
  • Policy and inspection limits: Read the complete root, scripts, and UI AGENTS.md files; no deeper ancestor policies or maintainer-notes directory were present. Historical --follow and -S searches encountered unavailable old blobs; available path history, blame, and merged PR bodies establish the relevant intent. (AGENTS.md:1, 918f03fab997)

Likely related people:

  • Peter Steinberger: Raw commit 5559404 adds scripts/bench-control-ui-cold-load.ts:1 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 5559404e2da9; files: scripts/bench-control-ui-cold-load.ts)

PR surface

Tests +476, Other +152. Total +628 across 5 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 4 477 1 +476
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 163 11 +152
Total 5 640 12 +628

Review metrics

Metric Value Why it matters
Benchmark option 1 new opt-in flag --sidebar-list-churn requires --live-events and adds no persisted product setting.

Root-cause cluster

Relationship: canonical
Canonical: #172946
Summary: This PR continues the investigation after the earlier held-row-only experiment was explicitly withdrawn as off-target.

Members:

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

Labels

Label changes:

  • add P3: This is an internal diagnostic experiment with no application runtime change.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp 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:

  • P3: This is an internal diagnostic experiment with no application runtime change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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 15, 2026, 4:49 AM ET / 08:49 UTC.

@steipete
steipete force-pushed the steipete/coldload-sessions-list-delta branch from 918f03f to 4833669 Compare October 15, 2026 09:20
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime size: XL and removed size: L labels Oct 15, 2026
@steipete
steipete force-pushed the steipete/coldload-sessions-list-delta branch 3 times, most recently from 5204c01 to 8a823b1 Compare October 15, 2026 11:19
@steipete
steipete force-pushed the steipete/coldload-sessions-list-delta branch from 8a823b1 to 1ac2817 Compare October 15, 2026 11:49
@steipete steipete changed the title experiment(control-ui): reproduce paired sidebar list refreshes [do not merge] perf(control-ui): send sidebar session row deltas Oct 15, 2026
@steipete
steipete marked this pull request as ready for review October 15, 2026 12:33
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 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 ✅ Completed 2026-10-15T12:37:54.589089Z 1ac2817 Draft marked ready
ℹ️ 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.

@steipete
steipete merged commit 0e85fcf into main Oct 15, 2026
254 of 258 checks passed
@steipete
steipete deleted the steipete/coldload-sessions-list-delta branch October 15, 2026 15:07
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 16, 2026
…nclaw#172946)

Sidebar sessions.list refreshes can now ask for a delta against the client's last revision (ifRowsRevision: delta:<revision>). When the Gateway still retains that base window it returns only changed/inserted rows plus the complete window order; otherwise it falls back to the full list. Older Gateways treat the prefixed token as a revision miss and send the full list.

Root cause of Team's paired 5-second refreshes (full audit in the PR): events that cannot certify filtered membership (new cron/subagent/other-user rows entering the window, owner/pin/archive changes) correctly force authoritative refreshes of both sidebar windows, and each window's independent coordinator paces them on a 5 s cooldown. Refreshes stay authoritative; only the payload shrinks.

Seven interleaved AWS pairs with a Team-realistic event stream: refresh response bytes 759 KB -> 167 KB (-78%), changed replies carry 5-6 rows instead of 200+; client response-task time unchanged (79 ms). Runtime +60 LOC; the rest is bench/fixture/tests. CI red only on the unrelated web-awesome theme palette assertion, reproduced on main.
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 docs Improvements or additions to documentation gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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