Repository navigation
fix(ui): find sessions beyond the loaded search window - #138167
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: blocked before merge. Reviewed September 4, 2026, 7:10 AM ET / 11:10 UTC. ClawSweeper reviewWhat this changesMoves the Control UI Sessions quick filter to Gateway-side metadata matching before pagination, with debounced search requests and appendable matching pages. Merge readiness⛔ Blocked before merge - 2 items remain Keep open. Current main still filters only the already loaded Session rows, while this branch moves matching to the Gateway before pagination and adds focused coverage; exact-head CI is the remaining merge gate. Priority: P2 Review scores
Verification
How this fits togetherThe Control UI requests paged session metadata from the Gateway. The Gateway applies caller visibility and session scope, then returns matching rows and pagination state for the Sessions table. flowchart LR
A[Control UI search input] --> B[Sessions page]
B --> C[Gateway session list request]
C --> D[Visibility and scope checks]
D --> E[Session metadata matcher]
E --> F[Pagination]
F --> G[Sessions table and Load more]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +304, Tests +916, Docs 0, Other 0. Total +1220 across 38 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Complete exact-head required CI, then merge after the ordinary maintainer integration review confirms the current main interaction. Do we have a high-confidence way to reproduce the issue? Yes. The supplied real-Gateway baseline scenario places a known session outside the default 50-row window, and current-main source confirms that the browser filters only that loaded window. Is this the best way to solve the issue? Yes. Matching at the Gateway before pagination fixes the owner-boundary defect while retaining visibility checks, scoped filters, pagination, and a separate transcript-search path. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 93d3f565a7a6. 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 (2 earlier review cycles)
|
Ensure the retired-filter regression issues its delayed request after startup. Give the shared runtime formatter a distinct canonical name from the status resolver, preserving its implementation and all callers. CI follow-up for #138167; focused regressions, export guard, changed checks, and isolated Codex review passed.
40c3280 to
239f44b
Compare
Point the release-policy scenario at the maintained plugin-building guide after the ClawHub publishing source moved upstream. Preserve the repository-backed reference assertion and scenario execution. Validation: 58 catalog tests, formatting, and isolated Codex P0 review passed. Full changed checks continue before landing. CI repair for #138167.
|
Land-ready for CI run 33865835074, attempt 1 completed successfully on that exact head, including the required openclaw/ci-gate. The final local changed checks also passed: all typecheck groups, lint, guards, and runtime import cycles. The task checkout is clean and all 38 recorded source hashes match. Post-CI integration review: current main The latest ClawSweeper review, reviewed at 11:10 UTC against this exact head, has no actionable code/security finding. Its before-merge and Rank-up requests are addressed: required CI is green, and the post-CI current-main interaction was reviewed above. Fresh isolated Codex review passed at P0 for the complete integrated source (confidence 0.98) and the subsequent one-line QA docs reference (0.99). No P1/P2 certification is claimed. Live rules require the CI gate and do not impose an independent approval rule. Integration proof passed 253 Gateway tests, 93 UI owner/event/page tests, and three Chromium E2E scenarios. The final QA reference repair passed all 58 catalog tests and formatting. Exact commands: OPENCLAW_VITEST_MAX_WORKERS=2 node scripts/run-vitest.mjs src/gateway/session-utils.test.ts src/gateway/session-utils.search.test.ts src/gateway/session-utils.perf.test.ts ui/src/components/session-data-controller.event-refresh.test.ts ui/src/lib/sessions/session-roster-refresh.test.ts ui/src/lib/sessions/index.event-refresh.test.ts ui/src/pages/sessions/sessions-page.typing.test.ts ui/src/pages/sessions/sessions-page.roster.test.ts
node scripts/run-vitest.mjs run --config .artifacts/sessions-filter-typing-e2e.config.ts --configLoader runner ui/src/e2e/session-management.filtered-errors.e2e.test.ts
OPENCLAW_VITEST_MAX_WORKERS=2 node scripts/run-vitest.mjs extensions/qa-lab/src/scenario-catalog.test.ts
pnpm exec oxfmt --check qa/scenarios/plugins/clawhub-release-policy-contracts.yaml
node scripts/check-changed.mjs -- qa/scenarios/plugins/clawhub-release-policy-contracts.yamlCI history is retained in the PR body: run 33861367726 exposed the unissued delayed-error test fixture and formatter export collision; run 33864302758 exposed the stale QA docs reference inherited from main’s ClawHub docs move. Each was repaired at its owner without weakening guards, assertions, or budgets. The final run is green. The original real-Gateway proof covers 16,023 synthetic sessions, 18 scenarios, matching pagination 50 → 100 → 123, and ordinary typing with two serialized RPCs. Approved media remain available: before, after, full scenario video. Those recordings bind to the original build at 27ac738; later integration has the focused and hosted proof above. No new full package build, provider turns, transcript restoration, or retention-expiry proof is claimed. This closes only #138154; #136639 remains independent. Proceeding through native prepare and merge under the explicit landing authorization. Recovery note: the first native merge request was rejected with HTTP 405 because main changed during the request. The retained attempt is unaccepted, the PR remains open with no merge event, and its recorded process group and supervisor are gone. The native owner-specific lock recovery completed. Current main |
|
Merged via squash.
|
* fix(ui): find sessions beyond the loaded search window Move rich Sessions metadata matching before server pagination and serialize debounced page queries. Preserve agent/status visibility and independent transcript search; expose matching Load more pages. Closes openclaw#138154. Related: openclaw#136639 (separate retention work; no retention policy change). * fix(ui): resolve session filter validation failures Ensure the retired-filter regression issues its delayed request after startup. Give the shared runtime formatter a distinct canonical name from the status resolver, preserving its implementation and all callers. CI follow-up for openclaw#138167; focused regressions, export guard, changed checks, and isolated Codex review passed. * fix(qa): update the plugin publishing documentation reference Point the release-policy scenario at the maintained plugin-building guide after the ClawHub publishing source moved upstream. Preserve the repository-backed reference assertion and scenario execution. Validation: 58 catalog tests, formatting, and isolated Codex P0 review passed. Full changed checks continue before landing. CI repair for openclaw#138167.
Closes #138154.
Related: #136639 (preserve conversations under maintenance pressure). This fixes the separate pre-existing Sessions quick-filter limitation exposed during that work; it does not change retention policy.
Additional instructions
This is a same-repository branch and remains editable by maintainers.
What Problem This Solves
Fixes an issue where users searching the Sessions page would see No sessions match your filters for an existing conversation when it was outside the currently loaded rows. The default window is 50 rows. Status, runtime, goal, and agent-identity queries could also silently return incomplete results.
The old archived needle in a real 16,023-session synthetic fixture was at rank 8,021. Typing its exact label produced an empty table and no new
sessions.listrequest. The same failure affected an active needle at rank 8,001.Why This Change Was Made
The Gateway now owns rich metadata matching after caller visibility and before counting/pagination, sharing the same display projections as returned rows rather than hydrating every candidate. The page uses one debounced, serialized managed-query flow, removes its loaded-window predicate and competing route prefetch, and retains event/mutation refresh intent across query and connection lifecycles.
This preserves previous server metadata/model matches plus UI kind, rendered name, runtime/fallback, status/live/idle, goal objective/status/summary/usage/note, and assistant identity matching. Live-run facts participate before selection; completed nonempty searches cannot reuse a cache entry fenced only by previously returned rows. In-flight coalescing remains.
User Impact
Operators can find older active or archived sessions without raising the initial limit or downloading the complete roster into the browser. Load more sessions appends later matching windows. Agent and Active / Archived / All scopes remain effective, and typing no longer queues a full-store request per character.
Table sorting, grouping, overview counts, and rows-per-page remain loaded-window operations. Transcript search remains independent of the quick filter; bulk archived-session enumeration does not inherit search text. The command palette remains active-only. The Control UI guide source now describes these boundaries instead of claiming an exhaustive loaded list.
No schema/index/migration, product configuration option, protocol field/version, or dependency change is included.
Evidence
Original failure and real user flow
Real built Gateway plus Chromium, isolated state/home/config, 16,023 synthetic sessions, no mocked Gateway, no browser state injection, and no provider turns:
The attached before/after stills come from the real recordings. The video covers all 18 scenarios and final character typing. The sidebar was cropped only to remove local build metadata; no UI contents were generated or rewritten. The original captures were inspected (39 final PNGs and 72 video samples spanning the recording), and publication media was inspected separately. No secrets, private session content, or internal model identifiers are included. Sampled video inspection is not frame-by-frame certification.
This fixture proves metadata discovery and pagination, not retention expiry, transcript restoration, or provider execution.
Regression and sibling validation
Overlapping reruns are listed separately, not added into a unique-test count. Exact final UI/check commands:
Build and operational notes
A full build passed in an isolated normal clone after the original linked build correctly rejected an ancestor declaration-file change. The integrity guard was not bypassed. Core/server sources stayed unchanged afterward; the final eight UI/test changes received a separate UI rebuild and performance check, with complete source-tree byte/symlink matching. Final startup JS is 348,767 bytes gzip / eight requests, 15 bytes below the measured base; startup CSS is unchanged at 43,867 bytes / one request. No budget/baseline was increased.
The first final changed-check run failed strict process-group cleanup without a TypeScript diagnostic. Its process group was confirmed gone, and the complete serial retry passed without changing guards, deadlines, or assertions. This is recorded as a failed attempt, not hidden as a pass.
The recorded real-flow and build proof binds to initial commit
27ac738ec7de4724bc44752686790d2e52169629. The CI follow-up below changes one test fixture and mechanically renames the shared runtime formatter (plus formatter line wrapping); it does not change search or presentation behavior. Focused tests, fresh isolated review, and changed checks validate the follow-up; exact-head CI and the native landing gates remain required before merge.Scope and size
Production: +790 / -486 (net +304). Tests/support: +1311 / -395 (net +916). Docs: one paragraph replacement. Shared formatter moves and deletion of the local predicate/duplicate projections/competing prefetch offset part of the growth. The remainder provides lightweight pre-page rich projections and canonical query-lifecycle ownership; using full row hydration for every candidate or adding a second browser-side filter/cache would be smaller superficially but wrong for this boundary.
Separate follow-up: isolate declaration-build inputs from ancestor
node_modulesin linked worktrees while preserving the compiler integrity guard. No tooling workaround is included in this fix. The retention worktree/Testbox and the operator's running Gateway/state were untouched.attachment-1453416645.mp4
CI follow-up and maintainer disposition
Initial CI run 33861367726 exposed two causes across three jobs.
checks-ui (3/3)andchecks-node-compact-large-5passed their assertions but reported the same unhandled rejection: a delayed-error fixture queued its refresh behind startup, switched filters, then rejected a promise no request had consumed. The same file reproduced locally. The fixture now completes startup and asserts the delayed request was issued before retiring it; the original stale-error assertion remains.check-source-contractsfound the shared runtime formatter's export name collided with the distinct status resolver. The shared formatter and all Gateway/UI callers now useformatAgentRuntimeLabel; implementation and inputs are unchanged, with no alias or weakened guard.Follow-up commit:
40c328062cfc2bf79fff87a9f1dc074cbca49f54. The final five-file changed checks passed, including core/test/UI types, dead exports, lint, and guards.The corrected fixture and owner/event/page siblings passed 87 tests across five files. Formatter/search coverage passed 16 Gateway and 87 UI tests; the export-collision guard failed before and passed after the rename. The test-only changed check passed. The final five-file delta is +12/-11 (production net -3 from formatting; tests +4). Fresh isolated Codex autoreview of that delta is scoped-clean at P0, confidence 0.99; it does not certify P1/P2.
ClawSweeper's completed review identified no discrete functional or security defect. Maintainer scope disposition: retain one Gateway matcher before pagination and one serialized page query owner, with the duplicate browser predicate/prefetch removed. The remaining production growth is accepted for that boundary and rich-field preservation. Its exact-head-check requirement will be verified before native prepare/merge. The follow-up is test repair plus mechanical renaming, so the recent completed review remains applicable under the repository freshness policy.
Current-main integration
GitHub reported an actual conflict after the CI follow-up. The branch was rebased onto
1a611020d531413d1771b59a28168b7dab56c5a8; current candidate is239f44b3020e2d91f484c759b0762e54a8d4bba4. The only manual resolution retained main’s newresolveSelectedAndActiveModelimport beside registry imports moved by this repair. Main’s active-fallback row projection/tests and agent-scoped event filtering with the inlinedrefreshReplacementare preserved.git range-diffconfirms the repair patches otherwise replayed unchanged. Scope and LOC above are unchanged. No newer drift affected these 37 paths through main329c6f907f682ec35dcd8396db327ba6bc25cdd6.Fresh integration validation passed 253 Gateway tests + 93 UI owner/event/page tests, then 3 authored Chromium E2E scenarios. Owner tests ran on supported Node 26.8.1; E2E ran on Node 24.20.0. Fresh isolated Codex review of the complete integrated branch is scoped-clean at P0, confidence 0.98. The existing real-Gateway recordings still bind to the earlier build; these integration checks do not claim another full package build or recorded real-Gateway run.
CI 33864302758 exposed the inherited QA documentation-reference failure described below. Native prepare and merge remain gated on its required successful result. The mechanical conflict resolution preserves the reviewed behavior, so the recent ClawSweeper review remains applicable; its canonical-owner and scope requests are addressed above.
QA documentation-reference CI repair
CI job 100996139110 failed the existing repository-reference assertion for
clawhub-release-policy-contracts. Main’s ClawHub documentation ownership move removed the localdocs/clawhub/publishing.mdpage, leaving one stale QA reference. The scenario now referencesdocs/plugins/building-plugins.md, which covers package metadata and first publishing; its existing community-plugin reference still links the canonical publishing documentation. Scenario execution, success criteria, code references, and the repository-backed assertion are unchanged.Current head:
a1334a804d21e8bec669d46b922bd2b359dc2b7c. This follow-up is one YAML line replaced: test/support +1/-1, production 0. The full PR now touches 38 files; the 37 previously integrated files are byte-identical. All 58 catalog tests and formatting passed. Fresh isolated Codex review of the one-line delta is scoped-clean at P0, confidence 0.99. The original CI assertion failure was captured before editing. Repository changed checks passed, including all typecheck groups, lint, guards, and import cycles. Exact-head hosted CI also passed; native prepare/merge remains the landing path.OPENCLAW_VITEST_MAX_WORKERS=2 node scripts/run-vitest.mjs extensions/qa-lab/src/scenario-catalog.test.ts pnpm exec oxfmt --check qa/scenarios/plugins/clawhub-release-policy-contracts.yaml node scripts/check-changed.mjs -- qa/scenarios/plugins/clawhub-release-policy-contracts.yamlThe earlier failed UI shard, its second affected shard, the formatter contract guard, Control UI performance, and real-Gateway UI E2E all passed on the integrated head before this documentation-reference follow-up. The new head still requires its own successful CI; no skipped check or enlarged budget substitutes for it.
Final landing gate
CI run 33865835074 and its required openclaw/ci-gate passed on
a1334a804d21e8bec669d46b922bd2b359dc2b7c. Post-CI main245c5bac43653208bde0991496638b9048b147b1merges cleanly; all 38 candidate paths are byte-identical in that projection. The latest ClawSweeper review refreshed automatically to this exact head at 11:10 UTC and has no actionable code/security finding. Its Rank-up and before-merge requests—green required CI and current-main integration review—are addressed. Native review artifacts are complete; the explicit user landing authorization supplies the maintainer decision.