Skip to content

feat(web): bound session search pagination - #376

Open
seekskyworld wants to merge 2 commits into
openpi-dev:mainfrom
seekskyworld:feat/issue-349-search-pagination
Open

feat(web): bound session search pagination#376
seekskyworld wants to merge 2 commits into
openpi-dev:mainfrom
seekskyworld:feat/issue-349-search-pagination

Conversation

@seekskyworld

Copy link
Copy Markdown

Problem

Adds the pagination slice of #349. A bounded server search needs a stable way to retrieve additional results without loading an unbounded list.

Value

Clients can request 1-100 metadata results at a time with an explicit next offset.

Approach

Add validated offset and limit query parameters to the read-only Session search endpoint and adapter projection. Existing query, archive, and 200-character bounds remain enforced.

Validation

  • npx tsc --noEmit
  • git diff --check

Impact

  • User-visible behavior: paged search responses.
  • Model-visible context/tools: none.
  • Runtime/lifecycle: read-only projection.
  • Persisted config/data: none.
  • Compatibility/risk: additive endpoint; transcript indexing remains out of scope.

Signed-off-by: seekskyworld <djh1813553759@gmail.com>
Signed-off-by: seekskyworld <djh1813553759@gmail.com>

@tt-a1i tt-a1i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#362 冲突;不要当成 #387

分页上界(1–100、host 拒不安全 offset/limit)是对的,但:

  • #362searchSessions 参数个数 / nextOffset vs truncated 不兼容。两份里只留一份,或先 rebase。
  • q 返回 200 + []。最后一页长度刚好等于 limit 时会多出一个假 nextOffset
  • 没有测试。
  • 这是元数据搜索,不是 #387 的 transcript 正文搜索。

@tt-a1i tt-a1i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exact-head review: e202201

[P1] Pagination is applied after the same 500-session UI projection, so it cannot retrieve later canonical results. web/adapter/pi-adapter.ts:314-340 retains at most WEB_MAX_SESSIONS before searchSessions() filters and slices at lines 513-522. Any offset at or beyond 500 is empty, and even earlier pages omit matches that fell outside the newest 500 sessions. The endpoint can still emit a nextOffset as if more canonical search results were reachable.

This breaks the PR goal of stable bounded retrieval without loading an unbounded list. Please paginate a canonical or purpose-built bounded search traversal rather than the snapshot projection, and return continuation evidence derived from that traversal. Add tests with more than 500 sessions, including a unique late match and an offset beyond 500.

Verification boundary: exact-head static boundary analysis; current validation does not exercise data beyond the projection cap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants