Skip to content

perf(sessions): stop Control UI list refresh bursts - #164764

Merged
steipete merged 4 commits into
mainfrom
steipete/perf-micro-sessions-list-remaining-callers-20260919
Oct 4, 2026
Merged

steipete merged 4 commits into
mainfrom
steipete/perf-micro-sessions-list-remaining-callers-20260919

Conversation

@steipete

@steipete steipete commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Control UI session lists still sent full rows, and dashboard snapshot notifications restarted pagination. Slow/large responses did not identify which UI caller requested them.

User Impact

List views use compact rows and apply certified row updates without list refetches. Loaded dashboard pages stay with the managed list owner. Expanded settings and chat commands read exact session descriptors. Native clients retain the full-row default.

Slow and >=200 KiB sessions.list journal lines include bounded caller source, compact/full mode, limit, offset, and filter names. Filter text and identities are not logged; metric labels are unchanged.

Why This Change Was Made

The shared request builder still defaulted to full rows, including connection bootstrap. Disabled title/preview enrichment unnecessarily prevented the Sessions page from applying row events. The gallery kept a second paging loop outside its managed window. Child lists and the sidebar count facet also refreshed unchanged data.

The existing session capability owns list membership, request coalescing, and row provenance. Gallery pagination now extends that window. Prepared hasBoard and childOwnerSessionKeys receipts certify filtered membership; child ownership uses the Gateway's existing time-aware retention resolver and invalidates frozen presentations when owners expire. Count facets retain their aggregate only when admitted old/new facts prove unchanged contributions. Unknown membership, ownership/running/sharing/archive changes, incomplete ancestry, and overlapping reads retain authoritative refreshes. Healthy traffic uses the shared >=60 s fallback.

Changed callers: sidebar/bootstrap/children/counts, dashboard gallery and progress widgets, Activity, Sessions page, agent roster, chat commands, command palette, and Skill Workshop. Diagnostic source is excluded from query identity, so caller attribution does not fragment coalescing.

Production LOC: +252 net (502 additions, 250 deletions) using the requested exclusions (including 10 lines of scoped instructions and 2 test-helper assertion lines). Growth is required for permanent diagnostics, explicit board/child membership receipts and conservative event admission, and lifecycle-safe descriptor hydration after compact rows omit detail fields. The independent gallery pager, broad chat-command list/alias/cache lookup, and Activity's duplicate timer were removed. The existing v1 warm-roster cache retains only membership fields in its persisted query; wire-only source and row mode are omitted before its unchanged strict validation. No new configuration, dependency, persistent cache, or storage schema.

Evidence

UI/Gateway validation is green; CI is blocked by one unchanged native test fixture. Current-head CI on 869c477b2742d28a9afe6726e6fa00c012c882cd finished with 76 successful jobs, 13 intentional skips, and one root failure plus the derived CI-gate failure. All three UI unit shards, six mocked UI E2E shards, both real-Gateway shards, bundled protocol, types, builds, and every separate workflow passed. Testbox focused tests and the complete changed-file gate also passed.

The sole blocker is macos-swift packages: among 2,259 tests, ChatViewModelTests / history retry backoff does not retain an abandoned presentation timed out at ChatViewModelTests.swift:9715–9718 while waiting for its initial fixture bootstrap (27.208 s against the helper's 15 s polling budget). It never reached the abandonment behavior under test and uses TestChatTransport, not the Gateway. apps/shared is unchanged between the tested base f28801628446 and this PR. Current main was checked and still has this polling site. The native owner has an existing loadAndWaitBootstrap helper at line 457 that joins bootstrapTask; that is the next correction to validate. Native sources were not edited and the failed job was not blindly rerun, preserving this lane's explicit UI/Gateway boundary. The first full CI run exposed a real warm-roster cache admission regression and stale exact-request expectations. Both are repaired and independently reviewed on 869c477b2742d28a9afe6726e6fa00c012c882cd; the focused cache, warm-boot, and caller replays passed. Its unrelated inherited MCP test-type failure was fixed upstream by #164795 and integrated by rebasing onto f28801628446a76a77fc856b01c87464fe7701a4. All 62 task-file blobs are identical across that rebase, with only four lane commits above main.

The real browser rig uses synthetic state, a dist Gateway and built Control UI, 501 sessions, 201 persisted dashboards, one tab across chat/dashboard/Sessions/Agents/Activity for five minutes, then five minutes of steady Agents traffic. It sends two actual sessions.patch updates per second and counts actual WebSocket response bytes. Routes are mutually exclusive; the sidebar and retained views share the connection. Before caller tags existed, classification uses recorded request shapes and is marked inferred. Fresh identical seeding after each build prevents the one-hour child-retention boundary from confounding the comparison. Latency speedups are not claimed on the shared rig.

Five-minute steady observation: 118 → 49 list calls (58.47% fewer) and 12,743,848 → 5,966,638 response bytes (53.18% fewer), with 600 successful row updates in each window.

Caller/query Before calls/min Before KB/response Before bytes/min After calls/min After KB/response After bytes/min
Agent roster 0.20 176.557 35,311 2.80 132.072 369,800
Dashboard gallery 11.60 214.137 2,483,969 0 — 0
Sidebar child pages 0 — 0 5.00 113.528 567,634
Sidebar ownership counts 11.80 2.498 29,472 1.00 2.016 2,016
Sidebar primary 0 — 0 1.00 253.871 253,870

KB is decimal. The new minute recovery path increases roster/primary/child reads, including five pages for the synthetic 500-child parent; those bytes are included in the totals. During the respective 60-second mounted-route windows, gallery reads fell 142 → 0 (2,602,944 → 0 B), Sessions-page reads 11 → 0 (1,036,728 → 0 B), and chat-child reads 12 → 0 (9,744 → 0 B). All 110 automatic candidate list requests across the campaign used compact rows and bounded source tags.

The controlled 200-row probe shrank 335,497 → 239,081 bytes (28.74%). Candidate full rows are 347,481 B after membership receipts; compact removes 108,400 B of detail metadata at the same scope.

Mechanism evidence: the original gallery issued 133 tail-page and 11 first-page reads in a minute, up to four calls in one second. A 200-row full response measured 335,497 bytes. An initial three-page full agent-roster burst was reproduced; the production recurrence frequency was not reproduced and is not claimed.

Validation:

  • Current-head Testbox replay (tbx_01m42sxksbkhbafj60yj5tg37q, blacksmith-testbox / openclaw-check): 305 tests in 6 files passed, Vitest 30.97 s / wrapper 31.75 s; full command including frozen installation 55.81 s. The complete changed-file gate passed in 23m 6.115s, including all 27 core test-type projects, core/UI types, formatting, lint, exports, and all guards. The 4-file E2E replay passed all 13 tests, Vitest 109.28 s / command including preparation 167.48 s. This covers the cache round trip, terminal-event state, sidebar/Activity/plugin callers, warm reload, dashboard demand, Sessions filtering, and real-Gateway command-palette search.
  • Independent Codex review: two complete scoped-clean verdicts through P2 for the implementation, plus scoped-clean reviews of the nullable-agent and observation-binding corrections. The cache/CI repair also has a scoped-clean review through P2. The implementation review includes child/count contracts and controller extraction; subsequent test changes only relocate an unchanged test and await initial bootstrap before measurement.
  • Original-code regression control: Sessions and dashboard stream cases each fail with 10 list reads instead of 0. Candidate passes. Baseline control ran in an isolated Testbox worktree with its own frozen-lockfile installation; wrapper 2.47 s.
  • Gateway diagnostics/protocol/board tests: five files passed, wrapper 79.89 s. Child-owner parity, time-only retirement, filtering, and read-cache siblings: four Gateway files plus UI event tests passed, wrapper 79.18 s; UI subset 31 tests / 2.35 s.
  • Focused UI lifecycle/command/pagination tests: 141 passed / 5.71 s. Final owner-count/sidebar tests: 44 passed / 2.80 s. After moving the aggregate event test to its event owner, 60 list/event tests passed / 1.87 s. Commands used node scripts/run-vitest.mjs <named files> --maxWorkers=1 (the pnpm test owner); these are wall/CI execution seconds, excluding lease transfer/build setup.
  • Built Control UI E2E matrix: four mounted-route cases passed / 2.462 s. The corrected real-Gateway E2E passed on the Linux rig: 1 file / 1 test, 13.967 s test body, 82.89 s Vitest / 86.15 s wrapper. It waits for initial deferred count bootstrap, proves visible event updates and zero list refetch before the one-minute fallback, then verifies recovery. The sole temporary fixture adaptation pins the isolated loopback port; assertions and candidate production code are unchanged. Runtime/UI build passed / 134.7 s.
  • Protocol generation and native determinism checks passed; no tracked native application code changes.
  • Prior-head changed-file gate (f175d1b73435): passed, exit 0, on the Linux rig using node scripts/check-changed.mjs --staged --timed after the authorized queue fallback. All 52 then-changed file blobs matched head f175d1b73435644e5e30bd83ec0d03ceb27fbc76. Core/UI types, all 27 core test-type projects, formatting, ratchets, export scans, lint, styles, import cycles, and remaining guards passed. Earlier runs caught an optional agent ID passed to a nullable helper and a deferred observation handle flagged by prefer-const; both now use explicit nullish state, with independent review. The existing main fix for the ratchet reader's ENOBUFS was integrated by rebase. No baselines, rules, or expected failures were relaxed.

Blacksmith Testbox provider/profile: blacksmith-testbox / openclaw-check. Original leases tbx_01m42cxtw73ma74s2k47jsm51k and tbx_01m42f1ykk8w40xkcfmq4gfpte are stopped. Replacement lease tbx_01m42hngnjavgdgkn9mn8zyb2t remained queued for about an hour and was stopped after the authorized rig fallback passed the remaining real-Gateway replay. Commands: focused node scripts/run-vitest.mjs ... --maxWorkers=1, pnpm protocol:check, and node scripts/check-changed.mjs against the pinned task base. The first lease compared with stale local main; selecting the published lane ref reduced sync from 26,055 files / ~2 min to 47–52 files / 9–12 s.

Reviewed source was based on 07e28778a9b451a34e157680153fd5af7479877a; head 0fc7ac46bc095fde339f5003616c4fd98d69d118 was rebased on 8a0b0c458bbdac520a8f99b4735144722f698be7. Every changed file was byte-identical across that rebase. The real-Gateway replay includes the absent-agent normalization (7e383c949281e1db72aedc40dec721f5646bbdda). Head f175d1b73435644e5e30bd83ec0d03ceb27fbc76 additionally initializes the private observation handle explicitly; optional-chain behavior and request/event logic are unchanged. Its complete patch hash matches the staged patch used by the final gate. The subsequent cache repair adds the fourth task commit, with its current-head validation described above. Production deployment/attribution remains outside this PR's proof. The client was openclaw-control-ui webchat; no native client was involved in this reproduction.

Limitations: synthetic single-tab Linux proof, no production rollout. The controlled comparison builds exited 0 with startup-JS warnings at 366.0 → 366.7 KiB against a 364.7 KiB target. After rebasing, the current Testbox build passes that budget at 364.6 KiB (373,342 B; limit 373,454 B). Its CSS is above the advisory target at 49.4 KiB but below the 50 KiB hard ceiling (610 B headroom). Synthetic dashboard iframes logged sandbox service-worker access denials (26 before / 20 after), with no mutation errors. The rig was shared, so no CPU or latency improvement is claimed.

Final Linux rig replay command (isolated state, runtime build, and Chromium under the task worktree; nice -n 10 ionice -c3):

node scripts/run-vitest.mjs run \
  --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner \
  --project ui-e2e-serial-standalone \
  ui/src/e2e/session-roster-request-rate.real-gateway.e2e.test.ts --maxWorkers=1

The steady RPC measurement uses one fresh browser context and one initial navigation, followed entirely by SPA navigation. The cache correction only changes the copied record sent to IndexedDB; writes neither publish live roster state nor trigger Gateway requests, and hydration cannot replace connected live state. The saved connected-RPC measurements remain tied to their measured revision; they do not prove warm-start persistence or measure IndexedDB CPU/timer effects.

Final Testbox lease: tbx_01m42sxksbkhbafj60yj5tg37q (blacksmith-testbox, openclaw-check), pinned to the current lane ref, stopped after proof and verified absent. All task-owned rig processes and remote worktrees are cleaned up. Earlier repair lease tbx_01m42s6nf34ny6pc9h8w0qjz3e was stopped when rebasing changed the base/head, before any command ran.

Current-head focused replay commands and browser costs

On tbx_01m42sxksbkhbafj60yj5tg37q, after verifying HEAD 869c477b2742d28a9afe6726e6fa00c012c882cd:

node scripts/run-vitest.mjs \
  ui/src/lib/sessions/session-roster-cache.test.ts \
  ui/src/lib/sessions/index.event-refresh.test.ts \
  ui/src/components/command-palette.test.ts \
  ui/src/plugins/control-ui-host.test.ts \
  ui/src/pages/activity/current-work.test.ts \
  ui/src/components/app-sidebar.sessions.test.ts --maxWorkers=1

OPENCLAW_RUN_NODE_SKIP_DTS_BUILD=1 node scripts/run-vitest.mjs run \
  --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner \
  ui/src/e2e/warm-boot.e2e.test.ts \
  ui/src/e2e/dashboards-list-demand.e2e.test.ts \
  ui/src/e2e/session-list-filter.e2e.test.ts \
  ui/src/e2e/command-palette-search.real-gateway.e2e.test.ts --maxWorkers=1
Browser file Tests File wall time
Real-Gateway command-palette search 1 26.394 s
Dashboard list demand 4 32.314 s
Session list filter 4 7.855 s
Warm boot 4 9.185 s

These existing flows exercise browser storage and profile isolation, visible retained-error rows, query stability, and per-tab demand. The repair adds no Gateway boots, polling loops, or timing waits. The dashboard file crosses 30 s because it exercises four real browser recovery/demand scenarios; owner-level unit tests cannot establish the rendered error/recovery and tab lifecycle contract.

Current-head complete Testbox gate

Provider blacksmith-testbox, lease tbx_01m42sxksbkhbafj60yj5tg37q, HEAD 869c477b2742d28a9afe6726e6fa00c012c882cd; exit 0.

node scripts/check-changed.mjs \
  --base f28801628446a76a77fc856b01c87464fe7701a4 --head HEAD --timed
[check:changed] summary
   197ms  ok         conflict markers
   351ms  ok         line-cap growth ratchet
   4.89s  ok         max-lines suppression ratchet
  10.43s  ok         assertion SAFETY comment ratchet
   1.97s  ok         SQLite worker ratchet
   764ms  ok         test timeout race ratchet
   9.82s  ok         first-party mock export ratchet
   167ms  ok         changelog attributions
   130ms  ok         doctor deprecation registry
   163ms  ok         guarded extension wildcard re-exports
   146ms  ok         plugin-sdk wildcard re-exports
   238ms  ok         duplicate scan target coverage
   236ms  ok         dependency pin guard
   278ms  ok         format changed files
   3.41s  ok         config docs baseline
   1.72s  ok         plugin boundaries
   7.28s  ok         wrapper shadowing
   417ms  ok         package patch guard
   273ms  ok         test temp creation report (warning-only)
  61.72s  ok         core tsgo graph boundary
   2.61s  ok         Control UI i18n catalog
  43.61s  ok         typecheck core
1006.01s  ok         typecheck core tests
  38.84s  ok         typecheck UI
   5.62s  ok         coercion helper declaration guard
   6.64s  ok         deprecated API usage
  55.91s  ok         dead export scan (skip with OPENCLAW_CHECK_CHANGED_SKIP_DEADCODE=1)
  19.69s  ok         lint core changed files
   455ms  ok         lint UI changed style files
   391ms  ok         lint UI changed style files
   402ms  ok         lint UI changed style files
   439ms  ok         lint UI changed style files
   384ms  ok         lint UI changed style files
   402ms  ok         lint UI changed style files
    17ms  ok         native state schema version guard
  51.43s  ok         database-first legacy-store guard
   204ms  ok         media download helper guard
   9.74s  ok         runtime sidecar loader guard
  10.88s  ok         runtime import cycles
   243ms  ok         webhook body guard
  10.75s  ok         pairing store guard
  10.32s  ok         pairing account guard

@clawsweeper

clawsweeper Bot commented Oct 4, 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 docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime size: XL labels Oct 4, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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 4, 2026
@clawsweeper

clawsweeper Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 4, 2026, 3:41 AM ET / 07:41 UTC (Revision 8).

ClawSweeper review

What this changes

The PR reduces Control UI session-list traffic through compact rows, shared dashboard pagination, certified event updates, on-demand details, and bounded caller diagnostics.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⛔ Blocked before merge - 3 items remain

The performance improvement remains useful beyond current main, but the previously reported compact-row context-budget regression still blocks merge. The available runtime evidence supports the traffic reduction.

Priority: P2
Reviewed head: 869c477b2742d28a9afe6726e6fa00c012c882cd

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Strong runtime measurements support useful performance work, but the unresolved initial-render regression prevents merge readiness.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The complete hash-matched body documents built Control UI callers exercising a dist Gateway through real WebSockets under sustained sessions.patch traffic, with fewer list calls and response bytes after the change. Separate current-head cache and warm-boot replays support the unchanged version-1 persisted-query contract. The related budget screenshots establish historical expected behavior, not this PR's performance proof.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The complete hash-matched body documents built Control UI callers exercising a dist Gateway through real WebSockets under sustained sessions.patch traffic, with fewer list calls and response bytes after the change. Separate current-head cache and warm-boot replays support the unchanged version-1 persisted-query contract. The related budget screenshots establish historical expected behavior, not this PR's performance proof.
Evidence reviewed 9 items Verified introduced trigger: The pinned introduced diff adds rowMode: compact to the Sessions-page query and makes the shared request builder always request compact rows. The checkout remains clean at the supplied original PR head.
Compact presentation loses the denominator: SESSION_ROW_DETAIL_FIELDS includes contextBudgetStatus. Gateway compact presentation deletes those fields, while resolveSessionContextLimit requires contextBudgetStatus.promptBudgetBeforeReserve to select the validated last-run budget.
Existing display contract and incomplete hydration: The collapsed table resolves its denominator immediately. Existing view coverage expects 160,000 / 180,000 tokens to render 89% danger. The new details controller selects only expandedSessionKey and therefore cannot restore that fact on initial collapsed rendering. The merged budget fix at #138666 and its inspected before/after screenshots establish this expected behavior.
Findings 1 actionable finding [P2] [P2] Preserve the prompt budget in compact Sessions table rows
Security None None.

How this fits together

The Control UI receives session lists and change events from the Gateway. Its shared session owner maintains list membership and row facts for the sidebar, dashboards, activity views, and session management.

flowchart TD
  A[Gateway session state] --> B[Compact lists and row events]
  B --> C[Shared session owner]
  C --> D{Membership established?}
  D -->|Yes| E[Update held rows]
  D -->|No| F[Paced authoritative refresh]
  E --> G[Control UI views]
  F --> G
  G --> H[Full details on expansion]
Loading

Before merge

  • [P2] Preserve the prompt budget in compact Sessions table rows (P2) - This previously reported blocker remains unfixed. Requesting compact rows makes Gateway presentation delete contextBudgetStatus, but the collapsed table still calls resolveSessionContextLimit. A fresh row with 160,000 used tokens, a validated 180,000 prompt budget, and a 200,000 cap therefore renders 80% warning instead of the established 89% danger state. The new details controller hydrates only expanded rows. Preserve the validated budget fact and cover initial compact-list rendering before descriptor or event enrichment.
  • Resolve merge risk (P1) - Fresh collapsed Sessions rows can understate prompt-budget usage until full-row enrichment arrives, changing an established danger indication into a warning.
  • Complete next step (P2) - Preserve the validated prompt-budget fact in compact Sessions rows and verify initial collapsed rendering before descriptor or event enrichment.

Findings

  • [P2] [P2] Preserve the prompt budget in compact Sessions table rows — ui/src/pages/sessions/list-query.ts:30-31
Agent review details

Security

None.

PR surface

Source +240, Tests +529, Docs +40. Total +809 across 62 files.

View PR surface stats
Area Files Added Removed Net
Source 32 490 250 +240
Tests 27 1007 478 +529
Docs 3 41 1 +40
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 62 1538 729 +809

Review metrics

Metric Value Why it matters
Production versus test growth production +240 net; tests/support +529 net Excluding docs and policy, growth is justified by membership receipts, diagnostics, and detail hydration while competing pagination and lookup paths are removed.
Observed list traffic 118 → 49 calls; 53.18% fewer response bytes The supplied five-minute real Gateway/browser comparison includes increased fallback reads rather than reporting only the callers that improved.

Merge-risk options

Maintainer options:

  1. Preserve the compact meter contract (recommended)
    Retain the validated prompt-budget fact in compact presentation and verify initial collapsed rendering before any descriptor or event enrichment.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Preserve the Gateway-validated contextBudgetStatus needed by collapsed session meters in compact rows; retain provenance invalidation and operator model-disclosure filtering, and add a regression covering the initial compact response before descriptor or event enrichment.

Technical review

Best possible solution:

Keep compact lists and shared refresh ownership while carrying the Gateway-validated budget fact needed by collapsed meters.

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

Yes, from source: load a fresh collapsed compact row with 160,000 used tokens, a validated 180,000 prompt budget, and a 200,000 cap. The omitted budget makes the meter show 80% warning instead of 89% danger; this review did not execute that path.

Is this the best way to solve the issue?

No, not completely: shared pagination and event reconciliation fit the existing owners, but compact presentation must preserve facts consumed by collapsed views.

Full review comments:

  • [P2] [P2] Preserve the prompt budget in compact Sessions table rows — ui/src/pages/sessions/list-query.ts:30-31
    This previously reported blocker remains unfixed. Requesting compact rows makes Gateway presentation delete contextBudgetStatus, but the collapsed table still calls resolveSessionContextLimit. A fresh row with 160,000 used tokens, a validated 180,000 prompt budget, and a 200,000 cap therefore renders 80% warning instead of the established 89% danger state. The new details controller hydrates only expanded rows. Preserve the validated budget fact and cover initial compact-list rendering before descriptor or event enrichment.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded performance improvement with a concrete, limited-impact context-meter regression.
  • merge-risk: 🚨 compatibility: Switching the Sessions page to compact rows drops a fact required by its existing initial-render budget display.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (live_output): The complete hash-matched body documents built Control UI callers exercising a dist Gateway through real WebSockets under sustained sessions.patch traffic, with fewer list calls and response bytes after the change. Separate current-head cache and warm-boot replays support the unchanged version-1 persisted-query contract. The related budget screenshots establish historical expected behavior, not this PR's performance proof.
  • proof: sufficient: Contributor real behavior proof is sufficient. The complete hash-matched body documents built Control UI callers exercising a dist Gateway through real WebSockets under sustained sessions.patch traffic, with fewer list calls and response bytes after the change. Separate current-head cache and warm-boot replays support the unchanged version-1 persisted-query contract. The related budget screenshots establish historical expected behavior, not this PR's performance proof.

Evidence

Acceptance criteria:

  • [P1] pnpm test src/gateway/session-row-event-parity.test.ts --maxWorkers=1.
  • [P1] pnpm test ui/src/pages/sessions/view.test.ts ui/src/pages/sessions/sessions-page.details.test.ts --maxWorkers=1.
  • [P1] pnpm test ui/src/lib/sessions/session-roster-cache.test.ts --maxWorkers=1.
  • [P1] git diff --check.
  • [P1] node scripts/check-changed.mjs --base f288016 --head HEAD --timed.

What I checked:

  • Verified introduced trigger: The pinned introduced diff adds rowMode: compact to the Sessions-page query and makes the shared request builder always request compact rows. The checkout remains clean at the supplied original PR head. (ui/src/pages/sessions/list-query.ts:31, 869c477b2742)
  • Compact presentation loses the denominator: SESSION_ROW_DETAIL_FIELDS includes contextBudgetStatus. Gateway compact presentation deletes those fields, while resolveSessionContextLimit requires contextBudgetStatus.promptBudgetBeforeReserve to select the validated last-run budget. (packages/gateway-protocol/src/session-row-fields.ts:11, 869c477b2742)
  • Existing display contract and incomplete hydration: The collapsed table resolves its denominator immediately. Existing view coverage expects 160,000 / 180,000 tokens to render 89% danger. The new details controller selects only expandedSessionKey and therefore cannot restore that fact on initial collapsed rendering. The merged budget fix at fix(control-ui): measure context usage against the effective token budget #138666 and its inspected before/after screenshots establish this expected behavior. (ui/src/pages/sessions/view.test.ts:1266, 869c477b2742)
  • Re-review continuity: The previous completed review assessed the same pinned head and reported this same budget finding. It remains present; this is a repeated unresolved finding, not a newly discovered concern. (ui/src/pages/sessions/list-query.ts:31, 869c477b2742)
  • Complete captured body and real runtime evidence: REST retrieval recovered the complete 17,686 UTF-16-unit body and exactly matched captured SHA-256 903f16476c3e3eddb0e24ac1cde97195c5f3f7bd50976f34e4df7fc458ed472f. Its built-Control-UI/dist-Gateway Chromium campaign used synthetic persisted sessions and dashboards, actual sessions.patch traffic, and measured WebSocket responses: 118 to 49 list calls and 12,743,848 to 5,966,638 bytes over five minutes, with 600 successful updates in each window. Current-head cache and browser replays are separately documented. No target code or embedded scripts were executed during review. (869c477b2742)
  • Existing-state cache compatibility: The cache writer removes source and rowMode before persisting the existing version-1 query shape; its strict reader and database version remain unchanged. Changed coverage reads both the candidate record and an older writer's record, and the complete captured body records current-head cache round-trip and warm-boot browser passes. (ui/src/lib/sessions/session-roster-cache.reader.ts:113, 869c477b2742)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peik S.: Raw commit 1580e46 adds ui/src/lib/sessions/context-budget.ts:8 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 1580e46654fb; files: ui/src/lib/sessions/context-budget.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Preserve the validated budget in fresh compact rows and add an initial-render regression before descriptor or event enrichment.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (7 earlier review cycles)
  • reviewed 2026-10-04T04:43:20.968Z sha 0fc7ac46bc095fde339f5003616c4fd98d69d118 :: needs changes before merge. :: [P2] [P2] Preserve the prompt budget in compact Sessions table rows
  • reviewed 2026-10-04T05:21:06.827Z sha 7e383c949281e1db72aedc40dec721f5646bbdda :: needs changes before merge. :: [P2] [P2] Preserve the prompt budget in compact Sessions table rows
  • reviewed 2026-10-04T05:52:27.487Z sha f175d1b73435644e5e30bd83ec0d03ceb27fbc76 :: needs changes before merge. :: [P2] [P2] Preserve the prompt budget in compact Sessions table rows
  • reviewed 2026-10-04T06:15:08.756Z sha f175d1b73435644e5e30bd83ec0d03ceb27fbc76 :: needs changes before merge. :: [P2] [P2] Preserve the prompt budget in compact Sessions table rows
  • reviewed 2026-10-04T06:42:42.509Z sha 869c477 :: blocked before merge. :: [P2] [P2] Preserve the prompt budget in compact Sessions table rows
  • reviewed 2026-10-04T07:01:34.571Z sha 869c477 :: blocked before merge. :: [P2] [P2] Preserve the prompt budget in compact Sessions table rows
  • reviewed 2026-10-04T07:20:09.610Z sha 869c477 :: blocked before merge. :: [P2] [P2] Preserve the prompt budget in compact Sessions table rows

@steipete
steipete marked this pull request as ready for review October 4, 2026 06:09
@steipete
steipete enabled auto-merge (squash) October 4, 2026 06:09
@github-actions

github-actions Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: 869c477b2742d28a9afe6726e6fa00c012c882cd
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/gateway/server/ws-connection/authenticated-request-dispatch.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.

Carefully review these changes before merging.

@steipete
steipete marked this pull request as draft October 4, 2026 06:32
auto-merge was automatically disabled October 4, 2026 06:32

Pull request was converted to draft

Use compact attributed UI list requests, retain managed dashboard pages, and reconcile certified row, board, child-owner, and unchanged count-facet facts before a minute fallback. Read expanded settings and chat command details through the existing descriptor owner. Preserve full native rows and authoritative refreshes for uncertain membership.
@steipete
steipete force-pushed the steipete/perf-micro-sessions-list-remaining-callers-20260919 branch from f175d1b to 869c477 Compare October 4, 2026 06:34
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. label Oct 4, 2026
@steipete
steipete marked this pull request as ready for review October 4, 2026 07:14
@steipete
steipete enabled auto-merge (squash) October 4, 2026 07:14
@steipete
steipete merged commit 69b2627 into main Oct 4, 2026
245 of 251 checks passed
@steipete
steipete deleted the steipete/perf-micro-sessions-list-remaining-callers-20260919 branch October 4, 2026 07:46
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 5, 2026
* perf(sessions): avoid Control UI list refresh bursts

Use compact attributed UI list requests, retain managed dashboard pages, and reconcile certified row, board, child-owner, and unchanged count-facet facts before a minute fallback. Read expanded settings and chat command details through the existing descriptor owner. Preserve full native rows and authoritative refreshes for uncertain membership.

* fix(sessions): normalize missing observer agent context

* fix(sessions): initialize the detail observation binding

* fix(sessions): preserve warm roster cache with compact queries
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 merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. security-sensitive-changed 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