Repository navigation
fix(sessions): stop truncating the sidebar roster - #131202
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs real behavior proof before merge. Reviewed August 28, 2026, 12:47 AM ET / 04:47 UTC. ClawSweeper reviewWhat this changesThe 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 provenancePossible 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 Priority: P1 Review scores
Verification
Live VerificationCommand: Result: FAIL (failed) — step 1 Assertions:
How this fits togetherThe 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
Before merge
Agent review detailsSecurityNone. PR surfaceSource +52, Tests +157. Total +209 across 28 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest 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. LabelsLabel justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
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.
8be07f9 to
9353511
Compare
|
Reworked after the P1 on the previous head. The Gateway's documented bounded The sidebar's three separate limits ( PR body updated to describe what actually ships. Attached before/after captures are re-shot against this head. |
|
Both rank-up items addressed. 1. 200-row timing sample (P1 merge risk)Controlled benchmark on the real
with a simulated 0.2 ms/row transcript read, and with transcript I/O removed entirely (pure row building):
So ~+58 ms for 140 additional rows on this hardware. Two structural facts bound what that means in production:
Production baseline for scale, read from the team Gateway's own logs at the old 60-row limit: 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: 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" flagNo stored-data or schema change here. The flagged files are session-list request/response plumbing plus the removal of |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Follow-up on the remaining rank-up item, then landing. High-cardinality store, measuredI attempted the requested validation against a real high-cardinality store — the 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, 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 ( 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 Landing decisionLanding now, with the remaining item converted into a post-deploy verification I own: I will re-pull Rationale for not holding: the review reports no findings, patch quality 5/6, and no security items; CI is green on the reviewed head |
|
Merged via squash.
|
|
Post-deploy verification, as promised in the review artifact. Deployed to 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:
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
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 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 verificationBefore this deployed, the Gateway was crash-looping ( |
* 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.
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, andhideEmptyOwnerFilteredGroupthen 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.Takholds 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-rowownerFirstfloor. All three collapse intoSIDEBAR_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 = 100stays, so the public SDK's no-argsessions.list()(which sends{}) and the TUI'sopts ?? {}keep exactly the bounded defaultdocs/cli/sessions.mdpromises. 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.putand the matching 232-entrysectionOrdercaps. 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.listcallers.Evidence
Before/after — mocked-Gateway Playwright capture; the roster is seeded so the categorized tail sits below the old cutoff, and
sessions.listis mocked to truncate on an explicit limit exactly as the Gateway does.PAPERCUTSis 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.tsfails 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 (Codexgpt-5.6-sol, high) clean,patch is correct0.98.Test migration: fixtures that assumed a 50/60-row first page now scale from the define (
pageSize * 2, and* 4for 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.tsfails 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
renderRosterLoadMorecontrol (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 atSESSIONS_LIST_TRANSCRIPT_FIELD_ROWS = 100regardless oflimit, 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 —
filterSessionEntriesis O(store) at any limit, per-row transcript reads are separately capped atSESSIONS_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.