Skip to content

fix(core): Bind AI provider skips to the isolation scope - #23570

Closed
JPeer264 wants to merge 1 commit into
developfrom
jp/ai-provider-skip-scope
Closed

fix(core): Bind AI provider skips to the isolation scope#23570
JPeer264 wants to merge 1 commit into
developfrom
jp/ai-provider-skip-scope

Conversation

@JPeer264

Copy link
Copy Markdown
Member

Follow up to #23151 (comment)

The AI provider skip registry was a module-global Set that the Node and Cloudflare clients cleared once per client. Skips are registered lazily by higher-level integrations at call time (LangChain marking its providers, Vercel AI marking Workers AI), so a single such call suppressed the spans of direct provider calls in every later request served by the same client: for the whole process on Node, for the whole isolate on Cloudflare.

The registry is now keyed on the isolation scope. A skip registered inside an invocation applies to that invocation only, one registered outside any invocation still applies everywhere. The per-client clear in the Node and Cloudflare clients is no longer needed.

Adds a Node integration test that sends a LangChain request followed by a direct Anthropic request on one server and asserts the second one keeps its span.

The AI provider skip registry was a module-global Set that the Node and
Cloudflare clients cleared once per client. Skips are registered lazily by
higher-level integrations at call time (LangChain marking its providers,
Vercel AI marking Workers AI), so a single such call suppressed the spans of
direct provider calls in every later request served by the same client: for
the whole process on Node, for the whole isolate on Cloudflare.

The registry is now keyed on the isolation scope. A skip registered inside an
invocation applies to that invocation only, one registered outside any
invocation still applies everywhere. The per-client clear in the Node and
Cloudflare clients is no longer needed.

Adds a Node integration test that sends a LangChain request followed by a
direct Anthropic request on one server and asserts the second one keeps its
span.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 28.57 kB - -
@sentry/browser - with treeshaking flags 26.92 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 26.82 kB - -
@sentry/browser (incl. Tracing) 48.37 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 48.39 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.27 kB - -
@sentry/browser (incl. Tracing, Replay) 87.77 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.23 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 92.47 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 105.14 kB - -
@sentry/browser (incl. Feedback) 45.81 kB - -
@sentry/browser (incl. sendFeedback) 33.36 kB - -
@sentry/browser (incl. FeedbackAsync) 38.47 kB - -
@sentry/browser (incl. Metrics) 29.52 kB - -
@sentry/browser (incl. Logs) 29.8 kB - -
@sentry/browser (incl. Metrics & Logs) 30.45 kB - -
@sentry/react 30.33 kB - -
@sentry/react (incl. Tracing) 50.56 kB - -
@sentry/vue 35.41 kB - -
@sentry/vue (incl. Tracing) 50.37 kB - -
@sentry/svelte 28.6 kB - -
CDN Bundle 30.32 kB - -
CDN Bundle (incl. Tracing) 48.9 kB - -
CDN Bundle (incl. Logs, Metrics) 32.54 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 50.78 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 72.91 kB - -
CDN Bundle (incl. Tracing, Replay) 86.35 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 88.19 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 92.09 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 94.04 kB - -
CDN Bundle - uncompressed 89.94 kB - -
CDN Bundle (incl. Tracing) - uncompressed 146.25 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 96.23 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 151.94 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 225.18 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 265.52 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 271.2 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 279.22 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 284.89 kB - -
@sentry/nextjs (client) 53.12 kB - -
@sentry/sveltekit (client) 48.8 kB - -
@sentry/core/server 65 kB +0.09% +52 B 🔺
@sentry/core/browser 52.16 kB +0.1% +52 B 🔺
@sentry/node 117.54 kB +0.02% +16 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 85.18 kB - -
@sentry/node - without tracing 82.03 kB -0.03% -18 B 🔽
@sentry/aws-serverless 91.48 kB -0.02% -13 B 🔽
@sentry/cloudflare (withSentry) - minified 196.21 kB -0.05% -88 B 🔽
@sentry/cloudflare (withSentry) 485.76 kB -0.04% -169 B 🔽

View base workflow run

@JPeer264

Copy link
Copy Markdown
Member Author

Closing for now as it might not be relevant

@JPeer264 JPeer264 closed this Aug 26, 2026
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.

1 participant