Skip to content

ref(cli): Build agent conversation details schema from @sentry/api - #2121

Merged
BYK merged 1 commit into
mainfrom
ref/cli-conversation-details-sdk-schema
Nov 9, 2026
Merged

BYK merged 1 commit into
mainfrom
ref/cli-conversation-details-sdk-schema

Conversation

@sentry-junior

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

Copy link
Copy Markdown
Contributor

Follow-up to #2108. getConversationSpans already calls the generated retrieveOrganizationAiConversation operation, but it validated the response with a schema written by hand. That schema drifted from the spec: upstream has typed stats as nullable since the endpoint shipped, while the CLI typed it as optional.

AgentConversationDetailsSchema and ConversationStatsSchema now take their field schemas from vRetrieveOrganizationAiConversationResponse, the same way TraceMetaSchema and the timeseries schemas do. A change to those fields now arrives with an @sentry/api bump.

Some parts still differ from the generated schema on purpose:

  • spans keeps the CLI's span schema, because the spec types spans as record<unknown>.
  • stats stays nullish. The spec says it is required, but older self-hosted servers leave it out.
  • Stats fields: only the six the CLI reads are required. The server added the token and cost breakdowns and usageByModel one at a time in Sep–Oct, so requiring them would reject recent self-hosted versions.
  • projects and webUrl are not validated, because the CLI doesn't read them.

via @BYK.

--

View Session in Sentry

Take conversationId, title, and the stats fields the CLI reads from the
generated vRetrieveOrganizationAiConversationResponse schema, so changes
to those fields arrive with an @sentry/api bump. Spans keep the CLI's own
schema because the spec types them as plain records, and stats stays
nullish for later pages and older self-hosted servers.

Co-Authored-By: BYK <126780+BYK@users.noreply.github.com>
@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 9:19pm UTC

Request Review

@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 9, 2026
@BYK
BYK enabled auto-merge (squash) November 9, 2026 21:24
@BYK
BYK merged commit 6d3f9b8 into main Nov 9, 2026
26 checks passed
@BYK
BYK deleted the ref/cli-conversation-details-sdk-schema branch November 9, 2026 21:31

This branch was previously deployed

1 inactive deployment
Preview — cbc4ef85 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

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant