Skip to content

fix(cli): Accept null stats on later agent conversation pages - #2108

Open
sentry-junior[bot] wants to merge 1 commit into
mainfrom
fix/cli-conversation-view-null-stats
Open

sentry-junior[bot] wants to merge 1 commit into
mainfrom
fix/cli-conversation-view-null-stats

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

sentry agent-conversation view fails on any conversation with more than one page of spans (1,000+):

Error: Unexpected response format from /organizations/<org>/agents/conversations/<id>/
  Invalid type: Expected Object but received null

The details endpoint returns stats on the first page and stats: null on every later page, as its API docs describe. AgentConversationDetailsSchema typed stats as optional, which allows the field to be missing but not null, so validation failed on page 2.

This changes the field to nullish. getConversationSpans already reads stats from the first page only. The new test covers a two-page response where page 2 sends stats: null. Without the fix it fails with the same error.

Fixes AGT-3286

via Ogi.

--

View Session [Sentry]

The conversation details endpoint returns stats on the first page and
stats: null on every page after it. The response schema only allowed a
missing stats field, so agent-conversation view failed with
"Unexpected response format" on any conversation with more than one
page of spans.

Co-Authored-By: Ognjen Bostjancic <ognjen.bostjancic@sentry.io>
@vercel

vercel Bot commented Nov 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
sentry-local Skipped Skipped Nov 9, 2026 2:37pm UTC

Request Review

@sentry-junior sentry-junior Bot added the CLI Sentry CLI and CLI documentation label Nov 9, 2026
@linear-code

linear-code Bot commented Nov 9, 2026

Copy link
Copy Markdown

AGT-3286

@obostjancic obostjancic self-assigned this Nov 9, 2026
@obostjancic
obostjancic marked this pull request as ready for review November 9, 2026 15:36
@github-actions github-actions Bot added the risk: low PR risk score: low label Nov 9, 2026

This branch was previously deployed

1 inactive deployment
Preview — 71049f9d Deployed Nov 9, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLI Sentry CLI and CLI documentation risk: low PR risk score: low

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant