Skip to content

fix(ai): Keep model output out of captured structured output errors - #3281

Merged
MathurAditya724 merged 1 commit into
mainfrom
fix/structured-output-error-cause
Nov 12, 2026
Merged

MathurAditya724 merged 1 commit into
mainfrom
fix/structured-output-error-cause

Conversation

@sentry-junior

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

Copy link
Copy Markdown
Contributor

When generateObject fails, completeObject attached the AI SDK NoObjectGeneratedError as the ProviderError cause. That error has a text field, and its cause (AI_JSONParseError or a type validation error) has the raw model output in its message. Sentry captured that chain. This breaks policies/data-redaction.md (no model responses in telemetry). Sentry also read lines of the output as stack frames, so one failure turned into many issues.

Now the cause is a new Error with only the SDK error's name, message, and stack. The AI SDK uses fixed messages here, such as No object generated: could not parse the response., so they never contain output. The invalid_response kind, retry behavior, and app.ai.provider_error.summary do not change.

Affected Sentry issues (ProviderError: AI provider error: invalid_response): JUNIOR-BN, JUNIOR-A1, JUNIOR-A8, JUNIOR-V5, JUNIOR-9H, JUNIOR-BG, JUNIOR-A5, JUNIOR-CS, JUNIOR-TP.

This does not change output token budgets. #2554 does that for Briefs, and it also records finish_reason and usage on the span when parsing fails.

via @MathurAditya724.

--

View Session [Sentry]

A failed generateObject attached the AI SDK NoObjectGeneratedError as the
ProviderError cause. Its parse or validation cause holds the raw model
output, so Sentry captured it and grouped each output as its own issue.

Keep only the fixed SDK error name, message, and stack as the cause.

Co-Authored-By: Aditya Mathur <[email protected]>
@vercel

vercel Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
junior-docs Ready Ready Preview Nov 12, 2026 3:54pm UTC

Request Review

@blacksmith-sh

blacksmith-sh Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Found 3 test failures on Blacksmith runners:

Failures

Test View Logs
[chromium] › packages/junior-dashboard/e2e/
conversations-mobile.spec.ts:772:1 › keeps the message in view while earlier history an
d late content load
View Logs
[chromium] › packages/junior-dashboard/e2e/
conversations.spec.ts:8:1 › records loaded conversation views
View Logs
packages/junior-dashboard/e2e/conversations.spec.ts/records loaded conversation views View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@github-actions

Copy link
Copy Markdown
Contributor

15 screenshot changes — 15 changed · 0 added · 0 removed

Review screenshots in Frameshift

Automation Run Details · Desktop
Automation Run Details · Desktop
Changed
Automation Skill Editor · Desktop
Automation Skill Editor · Desktop
Changed
Automation Skill Editor · Mobile
Automation Skill Editor · Mobile
Changed
Automations Runs Filters · Desktop
Automations Runs Filters · Desktop
Changed
Conversation Attachment Zoom · Desktop
Conversation Attachment Zoom · Desktop
Changed
Conversation Attachment Zoom · Mobile
Conversation Attachment Zoom · Mobile
Changed
Show 9 more changed screenshots
Conversation Captured Memories Popover · Desktop
Conversation Captured Memories Popover · Desktop
Changed
Conversation Captured Memories Popover · Mobile
Conversation Captured Memories Popover · Mobile
Changed
Conversation Details Watched Linked Work · Desktop
Conversation Details Watched Linked Work · Desktop
Changed
Conversation Long Transcript Touch · Mobile
Conversation Long Transcript Touch · Mobile
Changed
Conversation Question Stepper · Desktop
Conversation Question Stepper · Desktop
Changed
Conversation Question Stepper Light · Desktop
Conversation Question Stepper Light · Desktop
Changed
Conversation Share Details · Desktop
Conversation Share Details · Desktop
Changed
Push Notifications Tip · Desktop
Push Notifications Tip · Desktop
Changed
Settings Mcp · Desktop
Settings Mcp · Desktop
Changed

@MathurAditya724
MathurAditya724 merged commit 9068d0d into main Nov 12, 2026
66 of 68 checks passed
@MathurAditya724
MathurAditya724 deleted the fix/structured-output-error-cause branch November 12, 2026 18:56

This branch was successfully deployed

1 active deployment
Preview – junior-docs — c2a74ccd Deployed Nov 12, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant