Add bounded session paging and search - #1086
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Codex review: found issues before merge. Reviewed August 5, 2026, 4:14 AM ET / 08:14 UTC. ClawSweeper reviewWhat this changesThe PR adds bounded paged session retrieval and debounced server-side session search, with a per-connection fallback for older Gateway request shapes. Merge readinessKeep open. The paging protocol is well exercised, but this draft changes the existing session-update path to publish up to 2,000 sessions into a current nonvirtualized composer menu; it should not land alone before that UI path is bounded or virtualized. Priority: P2 Review scores
Verification
How this fits togetherThe Windows gateway client retrieves session metadata from an OpenClaw Gateway and publishes it to chat consumers. This change adds paging, search, cancellation, and legacy compatibility between Gateway RPC responses and the tray’s session list. flowchart LR
Gateway[OpenClaw Gateway]
Client[Windows gateway client]
Fallback[Compatibility fallback]
Paging[Bounded paging and search]
Events[Session update event]
Picker[Chat session picker]
Gateway --> Client --> Fallback --> Paging --> Events --> Picker
Decision needed
Why: The safe merge boundary determines whether existing high-session users receive thousands of eagerly materialized menu items, which cannot be resolved by protocol tests alone. Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the existing event-driven picker bounded until a virtualized, searchable picker consumes the new query API, or land both parts as one proven stack with a high-session UI proof. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main sends the default session-list request, while the PR changes that same event path to publish the coordinator’s multi-page snapshot; the current picker eagerly maps every available session to a menu item. Is this the best way to solve the issue? No. The protocol coordinator is a viable foundation, but publishing its full result through the existing nonvirtualized picker before the dependent UI arrives is not the narrowest safe landing path. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d2de6150753b. LabelsLabel changes:
Label justifications:
EvidenceWhat 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 (10 earlier review cycles; latest 8 shown)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
@clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. |
Live Gateway proof on current headCurrent head: This proof ran the current-head The isolated Gateway, synthetic store, pairing state, and proof identity were destroyed after capture. No token, credential, user session, prompt, transcript, or file content is included. This live proof covers the stable expanded paging/search path. The exact legacy fallback remains deterministic compatibility-test coverage only; this PR does not claim live proof against an older Gateway binary. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Related to #953
Stack: 1 of 2. The virtualized/searchable picker will follow as a dependent PR.
Root cause
Windows sent an
agentId-onlysessions.listrequest, consumed the stable core default first 100 sessions, and discarded the paging metadata. A user with 1,000 sessions therefore saw only the first 100 and could not discover a matching session on row 900.Core already owns this server contract through openclaw/openclaw#85237 and the hidden-page paging precedent in openclaw/openclaw#89323. The stable request/result shape is available from v2026.5.22. This PR requires no core change and does not use beta/main-only fields.
What changed
agentId,limit,offset,search,configuredAgentsOnly, and the returned count/cursor metadata.INVALID_REQUESTcompatibility fallback. Legacy servers receive the old request exactly once and use bounded local search over only the authoritative visible title/subtitle.Scope
This is the lower protocol/query foundation only. It contains no picker UI, Reactor, localization, copy, or design changes.
Validation
Current head:
48d55f6cgit diff --checkReal behavior proof
The redacted current-head live proof ran the real
OpenClawGatewayClient.QuerySessionsAsyncagainst OpenClaw Gateway2026.7.1-beta.2with an isolated temporary home and exactly 1,000 synthetic sessions. It proves:proof-session-0900returned exactlyagent:main:proof-session-0900;The isolated Gateway, synthetic store, pairing state, and proof identity were destroyed after capture. The credential-free loopback Gateway test separately exercises the real
OpenClawGatewayClientWebSocket path. Its current-head proof source materializes 1,000 sessions through 10 paged request frames and proves server search returnsagent:main:900.The focused 12/12 proof also verifies:
No tokens, credentials, raw session keys, or user content are logged by the proof.
Review
Residual proof gap
The live proof covers the stable expanded paging/search path. Exact legacy fallback and bounded local search are covered deterministically in the current-head test suite, but are not claimed as live proof against an older Gateway binary because no older compatible launcher was available. No UI screenshot is applicable because this PR intentionally has no UI changes.