Skip to content

fix(conversations): Paginate conversation details to fetch all spans#111605

Merged
obostjancic merged 6 commits intomasterfrom
ognjenbostjancic/tet-2145-see-whats-wrong-with-modems-conversations
Mar 26, 2026
Merged

fix(conversations): Paginate conversation details to fetch all spans#111605
obostjancic merged 6 commits intomasterfrom
ognjenbostjancic/tet-2145-see-whats-wrong-with-modems-conversations

Conversation

@obostjancic
Copy link
Member

@obostjancic obostjancic commented Mar 26, 2026

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 "No messages found" while the overview correctly displayed firstInputlastOutput (which uses a separate query with a 10k limit filtered to ai_client spans only).

Switches useConversation from useApiQuery to useInfiniteApiQuery so 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

…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.
@linear-code
Copy link

linear-code bot commented Mar 26, 2026

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Mar 26, 2026
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.
@obostjancic obostjancic changed the title fix(conversations): Include spans with I/O data regardless of operation type fix(conversations): Paginate conversation details to fetch all spans Mar 26, 2026
@obostjancic obostjancic marked this pull request as ready for review March 26, 2026 10:16
@obostjancic obostjancic requested a review from a team as a code owner March 26, 2026 10:16
Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

@obostjancic obostjancic merged commit c9b7b31 into master Mar 26, 2026
70 checks passed
@obostjancic obostjancic deleted the ognjenbostjancic/tet-2145-see-whats-wrong-with-modems-conversations branch March 26, 2026 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants