M3: Client-side safety fixes for pagination edge cases#21565
Merged
Conversation
…k loading state Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Author
|
@codex review |
…imeout 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>
Contributor
Author
|
Addressed review feedback in 319dbb5 (pushed to
Resolved 3 threads (P1 cursor clearing, P1 window collapse, and stale doc comment). The trimming threads (P2) are out of scope for this fix. |
Contributor
Author
Contributor
Author
|
Codex Review: Didn't find any major issues. Keep it up! ℹ️ 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". |
5 tasks
Jasonnnz
added a commit
that referenced
this pull request
Mar 25, 2026
* 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
trimOldMessagesIfNeeded()from the pagination prepend branch inpopulateFromHistory()to prevent an infinite fetch-trim loop (trim removes just-fetched messages, resetting cursor, causing re-fetch)loadPreviousMessagePage()that callsresetMessagePagination()to prevent permanently stuck loading spinners when the daemon is unresponsiveTest plan
Part of #21550.
🤖 Generated with Claude Code