Skip to content

fix(v10/node): Stop leaking unhandled rejections on aborted Vercel AI streams - #24563

Merged
Lms24 merged 2 commits into
v10from
fix/v10-vercel-ai-aborted-stream-unhandled-rejection
Sep 22, 2026
Merged

Lms24 merged 2 commits into
v10from
fix/v10-vercel-ai-aborted-stream-unhandled-rejection

Conversation

@Lms24

@Lms24 Lms24 commented Sep 21, 2026

Copy link
Copy Markdown
Member

Backport of #24540

@cursor cursor Bot left a comment

Copy link
Copy Markdown

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.

Fix All in Cursor

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

Reviewed by Cursor Bugbot for commit f9c08eb. Configure here.

});
}

run();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Test omits expected abort handling

Medium Severity

The aborted-stream scenario iterates textStream and leaves run uncaught, so the abort itself can reject. Sentry's default unhandled-rejection warn mode then writes to stderr, which makes ensureNoErrorOutput fail even after the instrumentation fix and prevents the test from isolating the extra rejection this PR addresses. The sibling scenario-rejected-model scenario catches the expected failure; this one does not.

Additional Locations (1)
Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

Reviewed by Cursor Bugbot for commit f9c08eb. Configure here.

@github-actions

github-actions Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 27.84 kB added added
@sentry/browser - with treeshaking flags 26.27 kB added added
@sentry/browser (incl. Tracing) 46.7 kB added added
@sentry/browser (incl. Tracing + Span Streaming) 48.48 kB added added
@sentry/browser (incl. Tracing, Profiling) 51.45 kB added added
@sentry/browser (incl. Tracing, Replay) 86 kB added added
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 75.61 kB added added
@sentry/browser (incl. Tracing, Replay with Canvas) 90.73 kB added added
@sentry/browser (incl. Tracing, Replay, Feedback) 103.37 kB added added
@sentry/browser (incl. Feedback) 44.99 kB added added
@sentry/browser (incl. sendFeedback) 32.63 kB added added
@sentry/browser (incl. FeedbackAsync) 37.77 kB added added
@sentry/browser (incl. Metrics) 28.93 kB added added
@sentry/browser (incl. Logs) 29.16 kB added added
@sentry/browser (incl. Metrics & Logs) 29.85 kB added added
@sentry/react 29.63 kB added added
@sentry/react (incl. Tracing) 48.96 kB added added
@sentry/vue 33.25 kB added added
@sentry/vue (incl. Tracing) 48.69 kB added added
@sentry/svelte 27.86 kB added added
CDN Bundle 30.23 kB added added
CDN Bundle (incl. Tracing) 48.66 kB added added
CDN Bundle (incl. Logs, Metrics) 31.81 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) 49.98 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) 71.16 kB added added
CDN Bundle (incl. Tracing, Replay) 86.24 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 87.55 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) 92.03 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 93.33 kB added added
CDN Bundle - uncompressed 90.04 kB added added
CDN Bundle (incl. Tracing) - uncompressed 146.85 kB added added
CDN Bundle (incl. Logs, Metrics) - uncompressed 94.75 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 150.83 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 219.71 kB added added
CDN Bundle (incl. Tracing, Replay) - uncompressed 266.28 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 270.25 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 279.98 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 283.94 kB added added
@sentry/nextjs (client) 51.52 kB added added
@sentry/sveltekit (client) 47.13 kB added added
@sentry/core/server 80.85 kB added added
@sentry/core/browser 67.02 kB added added
@sentry/node-core 63.53 kB added added
@sentry/node 126.25 kB added added
@sentry/node (incl. diagnostics channel injection) 170.37 kB added added
@sentry/node/import (ESM hook with diagnostics-channel injection) 166 B added added
@sentry/node/light 51.68 kB added added
@sentry/node - without tracing 75.26 kB added added
@sentry/aws-serverless 84.48 kB added added
@sentry/cloudflare (withSentry) - minified 203.28 kB added added
@sentry/cloudflare (withSentry) 500.81 kB added added

…l payload

The orchestrion Vercel AI path leaks unhandled rejections on an aborted stream
for the same reason as v11: `end(error)` annotated the span but left the payload
looking successful, so `beforeSpanEnd` enriched from the `StreamTextResult` and
read its promise-valued getters.
@Lms24 Lms24 changed the title fix(v10/node): Skip tool-call processing for streamed Vercel AI results fix(v10/node): Stop leaking unhandled rejections on aborted Vercel AI streams Sep 21, 2026
@Lms24 Lms24 self-assigned this Sep 22, 2026
@Lms24
Lms24 marked this pull request as ready for review September 22, 2026 08:27
@Lms24
Lms24 requested review from a team as code owners September 22, 2026 08:27
@Lms24
Lms24 requested review from isaacs and mydea and removed request for a team September 22, 2026 08:27
Comment thread packages/node/src/integrations/tracing/vercelai/instrumentation.ts
@Lms24
Lms24 merged commit 44506df into v10 Sep 22, 2026
313 of 314 checks passed
@Lms24
Lms24 deleted the fix/v10-vercel-ai-aborted-stream-unhandled-rejection branch September 22, 2026 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants