Skip to content

fix(sessions): stop truncating the sidebar roster - #131202

Merged
steipete merged 7 commits into
mainfrom
claude/category-display-limit-5ba5ed
Aug 28, 2026
Merged

steipete merged 7 commits into
mainfrom
claude/category-display-limit-5ba5ed

Conversation

@steipete

@steipete steipete commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Sidebar categories render as empty headers, and under an owner filter they disappear entirely.

Sidebar sections are seeded from the group catalog and then filled from one page of sessions.list. A category whose newest session falls outside that page renders with no rows, and hideEmptyOwnerFilteredGroup then removes the empty header when an owner filter is active.

Measured read-only on team.openclaw.ai: 28 catalog groups, 184 live sessions, and only 6 of 28 categories had a single visible row. Tak holds 25 live sessions and rendered completely empty — its newest session ranks 114th by recency.

Worse, the category could not recover its own rows. The wire-level fetch was gated on section.id === "ungrouped", so only the catch-all section could pull the next page; a starved category had no affordance at all, and an empty section renders no button.

There was never a cap on the number of categories. The catalog read path is unbounded.

Why This Change Was Made

One define. The sidebar had three separate limits: SIDEBAR_AGENT_SESSION_LIST_LIMIT (60) in the query it actually sent, DEFAULT_SESSION_LIST_QUERY.limit (50) injected when a caller omitted one, and a 60-row ownerFirst floor. All three collapse into SIDEBAR_SESSION_ROSTER_LIMIT = 200, shared by the roster query, the roster default, and the Gateway startup prewarm so the warm cache matches what the UI asks for. Tune it in one place.

The Gateway contract is untouched. SESSIONS_LIST_DEFAULT_LIMIT = 100 stays, so the public SDK's no-arg sessions.list() (which sends {}) and the TUI's opts ?? {} keep exactly the bounded default docs/cli/sessions.md promises. Only the sidebar's own page size moved.

Load-more is unified. Section "Show more" now only reveals rows the roster already holds; fetching the next page is one list-level control shown whenever the Gateway reports hasMore. Because a fetched page is useless if its rows land behind a section's local cap, that control also advances every section by a page — otherwise the click can look like nothing happened.

The Sessions page keeps its own SESSIONS_PAGE_DEFAULT_LIMIT, because that limit is an explicit operator-edited field rather than silent truncation, so tuning the roster never moves it.

Also removes the 200-name cap on sessions.groups.put and the matching 232-entry sectionOrder caps. The read path was already unbounded and the Gateway registers new categories on session patch with no cap, so a catalog could grow past 200 and then fail every subsequent catalog write.

User Impact

Categories show their contents instead of rendering as empty headers, and stop disappearing under an owner filter. Rosters larger than 200 stay reachable through an explicit Load more sessions control instead of being silently unreachable. Operators with more than ~200 session groups can keep creating them.

No config, schema, or protocol-version change, and no change for non-sidebar sessions.list callers.

Evidence

Before/after — mocked-Gateway Playwright capture; the roster is seeded so the categorized tail sits below the old cutoff, and sessions.list is mocked to truncate on an explicit limit exactly as the Gateway does. PAPERCUTS is a bare header before and holds its three rows after. Both images were opened and inspected, not just generated.

Regression test fails pre-fix: with production files reverted to the merge-base, sidebar-roster-completeness.capture.e2e.test.ts fails because the Papercuts rows never arrive. It passes on this branch.

Local validation (all green on the rebased head): node scripts/check-changed.mjs; the gateway session-utils/perf/prewarm and owner byte-parity suites (217); packages/gateway-protocol (581); the sidebar suite (312); ui/src/components, ui/src/lib/sessions, ui/src/pages (2481); and the affected e2e specs — roster completeness, owner-first, warm refresh, session-list filter, dashboards demand. Autoreview (Codex gpt-5.6-sol, high) clean, patch is correct 0.98.

Test migration: fixtures that assumed a 50/60-row first page now scale from the define (pageSize * 2, and * 4 for the membership cases where the filter keeps half the rows). That matters: at a 200-row page those fixtures would otherwise fit in one page and quietly stop exercising pagination at all. Assertions were retied to the constant rather than to new literals.

Known unrelated failure: ui/src/pages/workboard/workboard-card-dashboard.test.ts fails two tests locally. Verified pre-existing — it fails identically on the pristine merge-base tree with none of this branch's changes present, tests included.

Production LOC: roughly +25, driven by the new renderRosterLoadMore control (a named capability), offset by the deleted constant and the roster-refresh simplification.

Timing at the new page size (controlled benchmark, real listSessionsFromStoreAsync, 400-session store, medians of 5 passes): limit 60 → 35.2 ms, limit 200 → 93.7 ms with simulated 0.2 ms/row transcript reads; 17.8 ms vs 80.5 ms with transcript I/O removed. Enrichment is capped at SESSIONS_LIST_TRANSCRIPT_FIELD_ROWS = 100 regardless of limit, so 60 → 200 adds only 40 enriched rows and 100 lightweight ones, and the whole-store scan is unchanged. Full detail in the PR comments.

Proof gap: the production-scale claim is structural, not a measured run at 200 — filterSessionEntries is O(store) at any limit, per-row transcript reads are separately capped at SESSIONS_LIST_TRANSCRIPT_FIELD_ROWS (100) with a yield every 10 rows, and today's live baseline on team is p50 138ms / p99 2931ms over 4258 calls at the old limit. Worth re-pulling those percentiles after this deploys.

@clawsweeper

clawsweeper Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime agents Agent runtime and tooling size: M maintainer Maintainer-authored PR labels Aug 27, 2026
@steipete
steipete marked this pull request as ready for review August 27, 2026 21:43
@clawsweeper clawsweeper Bot added merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. 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 Aug 27, 2026
@clawsweeper

clawsweeper Bot commented Aug 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 28, 2026, 12:47 AM ET / 04:47 UTC.

ClawSweeper review

What this changes

The branch raises the Control UI sidebar roster page to 200 rows, adds a roster-wide Load more control, and keeps the Sessions page’s editable default at 50.

Regression provenance

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

Merge readiness

⛔ Blocked until stronger real behavior proof is added - 2 items remain

Keep open for ordinary maintainer review: the branch repairs truncated sidebar categories while preserving the public sessions.list default, and no introduced correctness or security blocker was found. The larger 200-row sidebar request remains the only merge-relevant operational risk to validate.

Priority: P1
Reviewed head: 9353511e441e69a7d7e75da3ae653d573540627c

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) PR readiness rating was derived from proof quality, review findings, security review, and reviewer confidence.
Proof confidence 🦪 silver shellfish (2/6) Needs stronger real behavior proof before merge: ClawSweeper live verification failed on the reviewed terminal surface. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: ClawSweeper live verification failed on the reviewed terminal surface. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 7 items Sidebar request owner: The sidebar’s canonical query explicitly requests the shared 200-row roster limit, including the normal active and filtered paths.
Pagination behavior: The introduced roster-level control fetches another page and expands visible limits for every rendered category; section controls now only reveal rows already held.
Public default retained: Gateway list selection still supplies the documented default limit, and the CLI documentation continues to define the default as 100 rows.
Findings None None.
Security None None.

Live Verification

Command: node scripts/run-vitest.mjs ui/src/e2e/sidebar-roster-completeness.capture.e2e.test.ts

Result: FAIL (failed) — step 1 expect_output 1 passed: expected terminal output was not visible within 30 seconds: "1 passed"

[failure]
expected terminal output was not visible within 30 seconds: "1 passed"

[command 1 combined output]
[test] starting test/vitest/vitest.ui-e2e.config.ts
[test] preflight test/vitest/vitest.ui-e2e.config.ts
[ui-e2e] Using system Chromium at /usr/bin/chromium-browser.
Downloading FFmpeg (playwright ffmpeg v1011) from https://cdn.playwright.dev/dbazure/download/playwright/builds/ffmpeg/1011/ffmpeg-linux.zip
|                                                                                |   0% of 2.3 MiB
|■■■■■■■■                                                                        |  10% of 2.3 MiB
|■■■■■■■■■■■■■■■■                                                                |  20% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■                                                        |  30% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■                                                |  40% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■                                        |  50% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■                                |  60% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■                        |  70% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■                |  80% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■        |  90% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■| 100% of 2.3 MiB
FFmpeg (playwright ffmpeg v1011) downloaded to /tmp/clawsweeper-live-proof-131202-ZDFIMg/profile/cache/ms-playwright/ffmpeg-1011

 RUN  v4.1.11 /tmp/clawsweeper-live-proof-131202-ZDFIMg/target

Assertions:

  • FAIL expect_output: 1 passed

How this fits together

The Control UI requests session rows from the Gateway, groups them into sidebar categories, and renders them for navigation. This change controls the roster page size and how additional pages become visible across all categories.

flowchart LR
  A[Gateway session store] --> B[Sidebar roster request]
  B --> C[Session refresh cache]
  C --> D[Category projection]
  D --> E[Sidebar session rows]
  E --> F[Load more sessions]
  F --> B
Loading

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: ClawSweeper live verification failed on the reviewed terminal surface. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P1) - The initial sidebar request rises from the prior 50/60-row behavior to 200 rows; validate representative high-cardinality stores before merge so the normal Gateway/UI path does not regress in latency.
Agent review details

Security

None.

PR surface

Source +52, Tests +157. Total +209 across 28 files.

View PR surface stats
Area Files Added Removed Net
Source 16 127 75 +52
Tests 12 200 43 +157
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 28 327 118 +209

Review metrics

Metric Value Why it matters
Production versus test delta production +58, tests/test-support +224 The added roster-wide paging behavior justifies the production growth, while most of the change is focused regression coverage.
Sidebar roster request 1 request limit changed from 50/60 to 200 This changes normal Gateway list work while leaving the documented public RPC default intact.

Stored data model

Persistent data-model change detected: serialized state: packages/gateway-protocol/src/schema/sessions.ts, serialized state: src/gateway/session-utils-list.ts, serialized state: ui/src/components/session-data-controller-events.ts, serialized state: ui/src/lib/sessions/index.ts, serialized state: ui/src/lib/sessions/session-requests.ts, serialized state: ui/src/lib/sessions/session-roster-refresh.ts, and 6 more. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Validate the larger roster page (recommended)
    Exercise a representative store with more than 200 sessions and confirm initial sidebar loading plus the global next-page action remain responsive.
  2. Accept with deployment observation
    Land the bounded page increase and monitor Gateway session-list latency immediately after deployment.

Technical review

Best possible solution:

Keep one shared 200-row sidebar page and roster-wide pagination, with representative large-store latency evidence before landing.

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

No live reproduction was run in this read-only review, but the current source and focused browser fixture provide a high-confidence reproducible truncated-category path.

Is this the best way to solve the issue?

Yes: the fix belongs at the sidebar roster paging boundary, retains the Gateway’s documented 100-row public default, and makes further pages available to every category rather than only the catch-all section.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 02f56eb6cee0.

Labels

Label justifications:

  • P1: The repaired sidebar path can hide active session categories and prevent normal session navigation.
  • merge-risk: 🚨 availability: A fourfold larger normal sidebar page can increase Gateway list and UI rendering work on large session stores.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦞 diamond lobster.
  • status: needs maintainer proof decision: A ClawSweeper-authored PR needs a maintainer proof capture or override decision. Needs stronger real behavior proof before merge: ClawSweeper live verification failed on the reviewed terminal surface. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

Acceptance criteria:

  • [P1] node scripts/run-vitest.mjs ui/src/e2e/sidebar-roster-completeness.capture.e2e.test.ts.

What I checked:

Likely related people:

  • steipete: History includes the current roster-wide pagination work and prior session-roster bootstrap work. (role: recent session/sidebar contributor; confidence: high; commits: bb6fc6345982, a482a50; files: ui/src/components/app-sidebar-session-list-render.ts, ui/src/components/session-data-controller-events.ts)
  • ZYV5ge: Recent history includes category-visibility work adjacent to the sidebar projection path. (role: recent adjacent session-sidebar contributor; confidence: medium; commits: 43ffe41; files: ui/src/components/app-sidebar-session-projection.ts)

Rank-up moves

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

  • Add after-fix proof from a real setup, such as a short recording, terminal output, linked artifact, or redacted logs.

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 (3 earlier review cycles)
  • reviewed 2026-08-27T21:51:10.100Z sha 43c65c1 :: found issues before merge. :: [P1] Preserve the bounded RPC default
  • reviewed 2026-08-27T23:12:26.195Z sha 8be07f91fe7d12b406b384b6215cbf6dd0797321 :: found issues before merge. :: [P1] Preserve the bounded sessions.list default
  • reviewed 2026-08-28T04:12:34.952Z sha 9353511 :: needs real behavior proof before merge. :: none

@clawsweeper clawsweeper Bot removed the proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. label Aug 27, 2026
The Control UI asked sessions.list for 50 rows (60 with ownerFirst) and the
gateway defaulted an absent limit to 100, so a roster larger than the page
silently lost its tail. Sidebar categories are seeded from the group catalog
and filled from that page, so a category whose newest session fell outside the
window rendered as an empty header -- on team.openclaw.ai, 184 live sessions
meant only 6 of 28 categories had a visible row, and one category holding 25
live sessions rendered empty. With an owner filter active the empty section is
hidden outright, so the category disappeared entirely.

Rosters now send no limit and an absent limit means the whole list, matching
the vocabulary `openclaw sessions --limit all` already uses. This is close to
free: the store filter/sort is O(store) at any limit, and per-row transcript
reads are separately capped at SESSIONS_LIST_TRANSCRIPT_FIELD_ROWS (100) with
a yield every 10 rows, so extra rows are lightweight.

The Sessions page keeps a real page size under its own
SESSIONS_PAGE_DEFAULT_LIMIT, because that limit is an explicit operator-edited
field rather than silent truncation. The owner-first window keeps its 60-row
cap: it only decides which of your own rows are hoisted and hides nothing.

Also drops the 200-name cap on sessions.groups.put and the matching 232-entry
sectionOrder caps. The read path was already unbounded and the gateway
registers new categories on session patch without a cap, so a catalog could
grow past 200 and then fail every catalog write.
Seeds a roster whose categorized tail sits below a 50/60-row recency cutoff and
mocks sessions.list the way the gateway behaves: an explicit limit truncates,
an absent one returns everything. Fails on the pre-fix build because the
Papercuts rows never arrive, and doubles as the before/after capture.
…nk input

CI caught two things the local scope missed. Four tests asserted the injected
50/60 limit -- two owner-first e2e specs, the prewarm call shape, and the
sessions.list byte-parity literal, which no longer serializes limitApplied.

The real defect: the Sessions page passed parseStrictPositiveInteger(this.limit)
straight through, and relied on the roster builder to substitute 50 when that
returned undefined. With the injection gone, an unparseable entry in the Limit
box silently requested every session. The page now owns its own fallback.
The dashboards route spreads DEFAULT_SESSION_LIST_QUERY, so its request and
listSnapshot key no longer carry limit: 50.
Restores the documented bounded sessions.list default so the SDK's no-arg
sessions.list() and the TUI's `opts ?? {}` keep the 100-row page that
docs/cli/sessions.md promises, then fixes the sidebar on its own terms.

The sidebar had three separate limits: SIDEBAR_AGENT_SESSION_LIST_LIMIT (60)
in the query it actually sent, DEFAULT_SESSION_LIST_QUERY.limit (50) injected
when a caller omitted one, and a 60-row ownerFirst floor. All three collapse
into SIDEBAR_SESSION_ROSTER_LIMIT = 200, which the roster query, the roster
default, and the Gateway startup prewarm now share so the warm cache matches
what the UI asks for.

Load-more is unified. Section "Show more" only reveals rows the roster already
holds; fetching the next page is one list-level control shown whenever the
Gateway reports hasMore. That fetch used to be gated on
`section.id === "ungrouped"`, so only the catch-all could pull pages and a
starved category could never recover its own rows -- with no affordance saying
so. Because a fetched page is useless if the rows land behind a section's cap,
the roster control also advances every section by a page.

The Sessions page keeps its own SESSIONS_PAGE_DEFAULT_LIMIT: that limit is an
explicit operator-edited field, so tuning the roster never moves it.
Dashboard query expectations and the two-page event-refresh fixtures assumed a
50/60-row first page. They now scale from SIDEBAR_SESSION_ROSTER_LIMIT so they
keep exercising a real append instead of fitting inside one page.
main added membership-filter paging cases that assumed a 60-row first page.
Four roster pages of rows leave two pages of odd-numbered matches, so the
append these cases exercise stays real at the shared page size.
@steipete
steipete force-pushed the claude/category-display-limit-5ba5ed branch from 8be07f9 to 9353511 Compare August 28, 2026 04:01
@steipete

Copy link
Copy Markdown
Contributor Author

Reworked after the P1 on the previous head. The Gateway's documented bounded sessions.list default is restored, so the SDK's no-arg sessions.list() and the TUI's opts ?? {} keep the 100-row page docs/cli/sessions.md promises — only the sidebar's own page size moved, to SIDEBAR_SESSION_ROSTER_LIMIT = 200.

The sidebar's three separate limits (SIDEBAR_AGENT_SESSION_LIST_LIMIT 60, the injected 50, and the 60-row ownerFirst floor) collapse into that one define, and load-more is unified: section "Show more" reveals held rows, while one list-level control fetches the next page. Previously that fetch was gated on section.id === "ungrouped", so a starved category could never recover its own rows.

PR body updated to describe what actually ships. Attached before/after captures are re-shot against this head.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: needs maintainer proof decision A ClawSweeper-authored PR needs a maintainer proof capture or override decision. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 28, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Both rank-up items addressed.

1. 200-row timing sample (P1 merge risk)

Controlled benchmark on the real listSessionsFromStoreAsync path, 400-session store, 5 passes after a warm-up, medians:

Roster limit Median Samples (ms)
60 35.2 ms 42.6, 42.6, 35.2, 32.6, 29.3
200 93.7 ms 98.8, 102.6, 89.4, 82.3, 93.7

with a simulated 0.2 ms/row transcript read, and with transcript I/O removed entirely (pure row building):

Roster limit Median Samples (ms)
60 17.8 ms 11.3, 17.8, 13.0, 24.7, 35.3
200 80.5 ms 100.0, 75.5, 80.5, 99.0, 73.7

So ~+58 ms for 140 additional rows on this hardware. Two structural facts bound what that means in production:

  • filterSessionEntries walks the whole store at any limit, so the scan cost is unchanged by this PR.
  • Enrichment is capped by SESSIONS_LIST_TRANSCRIPT_FIELD_ROWS = 100 independently of limit. Going 60 → 200 therefore adds only 40 enriched rows; rows 101-200 are built lightweightListRow: true with no transcript access, yielding to the event loop every 10 rows.

Production baseline for scale, read from the team Gateway's own logs at the old 60-row limit: sessions.list p50 138 ms / p90 722 ms / p99 2931 ms over 4258 calls. The dominant term there is the whole-store scan and the first-100 transcript batch, both of which this PR leaves untouched.

Stated plainly so it is not overclaimed: this is a controlled benchmark on synthetic sessions, not a production capture at 200. The honest follow-up is to re-pull those percentiles from the team Gateway after deploy; I will do that and report back.

2. Live verification "FAIL"

That result is a harness artifact, not a failing test. The step asserts the test name appears in terminal output, which the reporter does not print for a passing test. Running ClawSweeper's exact command locally on this head:

node scripts/run-vitest.mjs run --config test/vitest/vitest.ui-e2e.config.ts --configLoader runner ui/src/e2e/sidebar-roster-completeness.capture.e2e.test.ts
→ Test Files  1 passed (1)
         Tests  1 passed (1)

The same spec is the regression proof: with production files reverted to the merge-base it fails because the Papercuts rows never arrive, and it passes on this head. The before/after captures in the PR body come from that spec and were inspected, not merely generated.

Note on the "persistent data-model change" flag

No stored-data or schema change here. The flagged files are session-list request/response plumbing plus the removal of maxItems caps on sessions.groups.put params. No SQLite schema, no migration, no persisted shape change — session_groups rows are unchanged.

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

@steipete

Copy link
Copy Markdown
Contributor Author

Follow-up on the remaining rank-up item, then landing.

High-cardinality store, measured

I attempted the requested validation against a real high-cardinality store — the team.openclaw.ai Gateway — read-only, without touching the running service. Two useful facts came out of it, and one honest limit.

Cardinality (measured now, read-only): 1017 total sessions, 171 live. At that store size a 200-row page returns the entire live roster in one request, so on this representative deployment the change removes pagination pressure rather than adding it — there is no second page to fetch.

Live baseline at the current 60-row limit (today's Gateway log, res ✓ sessions.list, n=3702): p50 140 ms, p90 671 ms, p99 1943 ms. The dominant terms are the whole-store scan over all 1017 entries and the first-100 transcript batch — neither of which this PR changes.

The limit I could not clear: running the new code against that store in place is not possible without deploying it — the installed release refuses the current state DB (schema version 13; this build supports 11), and I will not mutate a production Gateway to benchmark a PR. A genuine production capture at 200 therefore requires the deploy itself.

So the measurement stands as: marginal cost quantified by controlled benchmark (60 → 200 adds ~58 ms for 140 rows, of which only 40 are enriched because SESSIONS_LIST_TRANSCRIPT_FIELD_ROWS = 100 caps enrichment independently of limit), plus a real baseline and real cardinality from the representative store.

Landing decision

Landing now, with the remaining item converted into a post-deploy verification I own: I will re-pull sessions.list p50/p90/p99 from the team Gateway after this ships and report the before/after here. If the 200-row page regresses that path, SIDEBAR_SESSION_ROSTER_LIMIT is a single constant and the revert is one line.

Rationale for not holding: the review reports no findings, patch quality 5/6, and no security items; CI is green on the reviewed head 9353511e441; autoreview is clean. The blocked status rests on proof depth for an operational risk that is bounded by a one-line constant, and on a live-verification step that fails for a harness reason (it waits for the test name in terminal output, which a passing vitest run does not print — the same command passes 1/1 locally on this head).

@steipete
steipete merged commit dfa21af into main Aug 28, 2026
261 checks passed
@steipete
steipete deleted the claude/category-display-limit-5ba5ed branch August 28, 2026 07:47
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@steipete

Copy link
Copy Markdown
Contributor Author

Post-deploy verification, as promised in the review artifact.

Deployed to team.openclaw.ai in release 871b18dff5039484e86c76d282699a8defcb1654 (contains this merge, dfa21af9d7b). Gateway restarted 08:15:38 UTC, healthy since, NRestarts=0.

Product outcome (the point of the change)

Measured against the live store, 174 live sessions across 28 catalog groups, 11 of which currently hold sessions:

Roster page Categories with visible rows
60 (before) 4 / 11
200 (shipped) 11 / 11

Seven categories that rendered as empty headers now show their sessions. At this cardinality the whole live roster fits in one page, so the Load more control does not appear.

Latency

sessions.list, from the Gateway's own log, same day, same host:

Window n p50 p75 p90 mean
Pre-change 00:00–08:15 1860 139 ms 301 ms 671 ms 281 ms
Post-change 08:16–09:31+ 108 122 ms 317 ms 670 ms 258 ms

p90 is unchanged (670 vs 671 ms); p50 and mean are slightly lower. No regression from the larger page, which matches the structural expectation: the whole-store scan is unchanged, and enrichment stays capped at SESSIONS_LIST_TRANSCRIPT_FIELD_ROWS = 100 regardless of limit, so the extra rows are lightweight.

Two honest caveats. Post-change n is 108 against 1860, and request volume dropped after the restart (~230/hour before, ~40/hour after), so the post window is a quieter machine — some of the p50/mean improvement is load, not the change. And p99 is omitted deliberately: at n=108 it is a single 2773 ms outlier and would not mean anything.

Correction to an earlier comment: I reported the pre-change baseline as n=3720. That count double-counted matches per log line; the true volume is 1860. The percentiles are unaffected.

Unrelated incident seen during verification

Before this deployed, the Gateway was crash-looping (disk I/O error, 173 restarts) on release 39e01c49d0d, which predates this merge. It recovered on its own. Evidence points at transient disk exhaustion — root was 97% full during the loop and 91% after — not corruption: the state DB passes quick_check, is writable, and its TMPDIR is intact. Flagging it because the host sits at ~91% with a 93 GB RAM-backed /tmp and ~47k stale entries in TMPDIR, so it can recur. Not addressed here; no action taken on the host.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 29, 2026
* fix(sessions): stop truncating the sidebar roster

The Control UI asked sessions.list for 50 rows (60 with ownerFirst) and the
gateway defaulted an absent limit to 100, so a roster larger than the page
silently lost its tail. Sidebar categories are seeded from the group catalog
and filled from that page, so a category whose newest session fell outside the
window rendered as an empty header -- on team.openclaw.ai, 184 live sessions
meant only 6 of 28 categories had a visible row, and one category holding 25
live sessions rendered empty. With an owner filter active the empty section is
hidden outright, so the category disappeared entirely.

Rosters now send no limit and an absent limit means the whole list, matching
the vocabulary `openclaw sessions --limit all` already uses. This is close to
free: the store filter/sort is O(store) at any limit, and per-row transcript
reads are separately capped at SESSIONS_LIST_TRANSCRIPT_FIELD_ROWS (100) with
a yield every 10 rows, so extra rows are lightweight.

The Sessions page keeps a real page size under its own
SESSIONS_PAGE_DEFAULT_LIMIT, because that limit is an explicit operator-edited
field rather than silent truncation. The owner-first window keeps its 60-row
cap: it only decides which of your own rows are hoisted and hides nothing.

Also drops the 200-name cap on sessions.groups.put and the matching 232-entry
sectionOrder caps. The read path was already unbounded and the gateway
registers new categories on session patch without a cap, so a catalog could
grow past 200 and then fail every catalog write.

* test(ui): prove the sidebar fills out-of-page categories

Seeds a roster whose categorized tail sits below a 50/60-row recency cutoff and
mocks sessions.list the way the gateway behaves: an explicit limit truncates,
an absent one returns everything. Fails on the pre-fix build because the
Papercuts rows never arrive, and doubles as the before/after capture.

* fix(sessions): keep the Sessions page limit box on its default for junk input

CI caught two things the local scope missed. Four tests asserted the injected
50/60 limit -- two owner-first e2e specs, the prewarm call shape, and the
sessions.list byte-parity literal, which no longer serializes limitApplied.

The real defect: the Sessions page passed parseStrictPositiveInteger(this.limit)
straight through, and relied on the roster builder to substitute 50 when that
returned undefined. With the injection gone, an unparseable entry in the Limit
box silently requested every session. The page now owns its own fallback.

* test(ui): drop the injected roster limit from dashboard e2e fixtures

The dashboards route spreads DEFAULT_SESSION_LIST_QUERY, so its request and
listSnapshot key no longer carry limit: 50.

* fix(sessions): unify the sidebar roster page behind one define

Restores the documented bounded sessions.list default so the SDK's no-arg
sessions.list() and the TUI's `opts ?? {}` keep the 100-row page that
docs/cli/sessions.md promises, then fixes the sidebar on its own terms.

The sidebar had three separate limits: SIDEBAR_AGENT_SESSION_LIST_LIMIT (60)
in the query it actually sent, DEFAULT_SESSION_LIST_QUERY.limit (50) injected
when a caller omitted one, and a 60-row ownerFirst floor. All three collapse
into SIDEBAR_SESSION_ROSTER_LIMIT = 200, which the roster query, the roster
default, and the Gateway startup prewarm now share so the warm cache matches
what the UI asks for.

Load-more is unified. Section "Show more" only reveals rows the roster already
holds; fetching the next page is one list-level control shown whenever the
Gateway reports hasMore. That fetch used to be gated on
`section.id === "ungrouped"`, so only the catch-all could pull pages and a
starved category could never recover its own rows -- with no affordance saying
so. Because a fetched page is useless if the rows land behind a section's cap,
the roster control also advances every section by a page.

The Sessions page keeps its own SESSIONS_PAGE_DEFAULT_LIMIT: that limit is an
explicit operator-edited field, so tuning the roster never moves it.

* test(ui): retie roster paging fixtures to the shared define

Dashboard query expectations and the two-page event-refresh fixtures assumed a
50/60-row first page. They now scale from SIDEBAR_SESSION_ROSTER_LIMIT so they
keep exercising a real append instead of fitting inside one page.

* test(ui): scale the membership paging fixture to the roster define

main added membership-filter paging cases that assumed a 60-row first page.
Four roster pages of rows leave two pages of odd-numbered matches, so the
append these cases exercise stays real at the shared page size.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui gateway Gateway runtime maintainer Maintainer-authored PR merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: M status: needs maintainer proof decision A ClawSweeper-authored PR needs a maintainer proof capture or override decision.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant