Skip to content

fix(explore): Link conversation errors count to linked issues - #121505

Open
constantinius wants to merge 1 commit into
masterfrom
constantinius/fix/explore/TET-2757-conversation-errors-link
Open

fix(explore): Link conversation errors count to linked issues#121505
constantinius wants to merge 1 commit into
masterfrom
constantinius/fix/explore/TET-2757-conversation-errors-link

Conversation

@constantinius

@constantinius constantinius commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

The conversation "Errors" count linked to a spans query (span.status:[internal_error,error]) that never matched the errors it counts — those are linked error issues (node.errors), associated to spans by trace and often in a different project.

Now the count links to where its errors actually live:

  • Linked issues → issue stream (issue.id:[...], project=-1)
  • Span-status-only errors → traces explorer filtered to the conversation

Refs TET-2757

@linear-code

linear-code Bot commented Aug 7, 2026

Copy link
Copy Markdown

TET-2757

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Aug 7, 2026
The conversation overview's "Errors" count reflects linked error issues on the conversation's spans (node.errors), but the count linked to a spans query filtered by gen_ai.conversation.id and span.status:[internal_error,error]. Error events don't carry gen_ai.conversation.id and are associated to spans by trace, often in a different project, so that query returned no results.

Link the count based on the same data it aggregates: when spans have linked error issues, point at the issue stream filtered by issue.id:[...] scoped to project=-1 since trace-linked errors can live in any project. When the count comes only from span.status errors with no linked issue, fall back to the traces explorer filtered to this conversation's error-status spans.

Refs TET-2757
@constantinius
constantinius force-pushed the constantinius/fix/explore/TET-2757-conversation-errors-link branch from b226f8a to cd072ce Compare August 7, 2026 07:45
@constantinius
constantinius marked this pull request as ready for review August 7, 2026 08:19
@constantinius
constantinius requested a review from a team as a code owner August 7, 2026 08:19
Comment on lines +357 to +367
// Linked error issues live in the issue stream; span-status errors without a
// linked issue fall back to the traces explorer. Undefined when there are none.
function getConversationErrorsUrl({
organization,
selection,
conversationId,
errorIssueIds,
errorCount,
}: {
conversationId: string;
errorCount: number;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bug: The error count can be higher than the number of errors on the linked page because the link only filters for linked issues, ignoring errors from span statuses.
Severity: MEDIUM

Suggested Fix

Update the getConversationErrorsUrl function to generate a URL that filters for both errors from linked issues and errors indicated by span statuses. This will ensure the linked page displays all errors contributing to the count shown in the UI.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location:
static/app/views/explore/conversations/components/conversationSummary.tsx#L354-L367

Potential issue: The error count displayed for a conversation can be higher than the
number of errors shown on the linked page. This occurs when a conversation includes both
errors from linked issues (`node.errors`) and errors indicated by a span's status
(`span.status`). The `hasError` function counts both types of errors for the total
`errorCount`. However, the link generated by `getConversationErrorsUrl` only filters by
the IDs from linked issues (`errorIssueIds`), omitting the span-status errors from the
destination page. This results in a discrepancy, for example, showing '2 errors' but
linking to a page with only one.

Did we get this right? 👍 / 👎 to inform future reviews.

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.

1 participant