fix(conversations): Paginate conversation details to fetch all spans#111605
Merged
obostjancic merged 6 commits intomasterfrom Mar 26, 2026
Merged
Conversation
…on type Conversations could show firstInput/lastOutput in the overview but display no messages in the details view. The root cause was that the details frontend filtered out spans lacking gen_ai.operation.type, even when those spans carried gen_ai.input/output.messages attributes.
The default 100 per page limit could cause ai_client spans with I/O to be paginated out when conversations have many spans.
The conversation details endpoint returns 100 spans per page by default. For conversations with many spans, the ai_client spans carrying I/O data could be beyond the first page, causing the messages panel to show nothing while the overview correctly displayed firstInput/lastOutput (which uses a separate query with a 10k limit filtered to ai_client spans only). Switch from useApiQuery to useInfiniteApiQuery to automatically fetch all pages (up to 10 pages of 1000 each). Revert the previous isGenAiSpan widening since pagination was the actual root cause.
…with-modems-conversations
static/app/views/insights/pages/conversations/hooks/useConversation.tsx
Outdated
Show resolved
Hide resolved
vgrozdanic
approved these changes
Mar 26, 2026
…with-modems-conversations
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
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.

The conversation details endpoint returns 100 spans per page by default. For conversations with many spans, the
ai_clientspans carrying I/O data could be beyond the first page, causing the messages panel to show "No messages found" while the overview correctly displayedfirstInputlastOutput(which uses a separate query with a 10k limit filtered toai_clientspans only).Switches
useConversationfromuseApiQuerytouseInfiniteApiQueryso all pages are fetched automatically (up to 10 pages of 1000 each, covering up to 10k spans — matching the overview's limit).Refs TET-2145