M2: Wire pagination into handleListMessages HTTP endpoint#21569
Conversation
Part of #21550 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… spec Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Pagination tests are covered in M4 (#21556) which depends on this PR. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b7b76bbe86
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Codex Review: Didn't find any major issues. What shall we delve into next? ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
* feat: add composite DB index and getMessagesPaginated() for message history pagination (#21562) Co-authored-by: Vellum Assistant <assistant@vellum.ai> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * M2: Wire pagination into handleListMessages HTTP endpoint (#21569) * feat: wire server-side pagination into handleListMessages HTTP endpoint Part of #21550 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: gate pagination fields behind isPaginated and regenerate openapi spec Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Vellum Assistant <assistant@vellum.ai> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * M3: Client-side safety fixes for pagination edge cases (#21565) * fix: remove trim-after-pagination and add 60s safety timeout for stuck loading state Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: use minimal state clear instead of resetMessagePagination() on timeout Replace resetMessagePagination() in the 60s timeout handler with a targeted clear of isLoadingMoreMessages + loadMoreTimeoutTask. This preserves the user's scroll position, historyCursor, and hasMoreHistory so they can retry by scrolling up, rather than collapsing the visible window. Also update doc comments to reflect the 30s/60s two-stage timeout behavior and the accepted misclassification tradeoff. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Vellum Assistant <assistant@vellum.ai> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * test: add pagination test suite for handleListMessages (#21578) Part of #21550. Adds 9 test cases covering backward compatibility, cursor pagination, strict exclusivity, hasMore logic, metadata correctness, empty conversations, and input validation. Co-authored-by: Vellum Assistant <assistant@vellum.ai> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix: remove duplicate guard let self in timeout closure (non-optional after first unwrap) --------- Co-authored-by: Vellum Assistant <assistant@vellum.ai> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Part of #21550. Updates handleListMessages to parse beforeTimestamp/limit query params, call getMessagesPaginated() when beforeTimestamp is present (Option A), seed interface diffs correctly for paginated pages, and return hasMore/oldestTimestamp/oldestMessageId metadata. Updates route schema.