Skip to content

wip fix(node): Actually check for ai require resolve to enforce the integraton#19188

Draft
RulaKhaled wants to merge 1 commit intodevelopfrom
resolve-cache-issue
Draft

wip fix(node): Actually check for ai require resolve to enforce the integraton#19188
RulaKhaled wants to merge 1 commit intodevelopfrom
resolve-cache-issue

Conversation

@RulaKhaled
Copy link
Member

@RulaKhaled RulaKhaled commented Feb 5, 2026

Vercel AI integration auto-detection was failing for vercel deployed Next.js 16 apps

During SDK init, shouldForceIntegration() checked for the 'ai' package by reading package.json from the filesystem
In serverless cold starts, filesystem wasn't ready yet → read failed silently → empty result cached
All subsequent checks returned the cached empty object → moduleList.ai always undefined → auto-detection broken

Solution:

  • Replaced filesystem-based detection with require.resolve('ai'):
  • No race conditions
  • Works in all environments
  • Less code :D

closes #19147

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

Codecov Results 📊


Generated by Codecov Action

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

node-overhead report 🧳

Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.

Scenario Requests/s % of Baseline Prev. Requests/s Change %
GET Baseline 9,127 - 9,547 -4%
GET With Sentry 1,675 18% 1,751 -4%
GET With Sentry (error only) 6,156 67% 6,252 -2%
POST Baseline 1,185 - 1,210 -2%
POST With Sentry 595 50% 611 -3%
POST With Sentry (error only) 1,060 89% 1,062 -0%
MYSQL Baseline 3,337 - 3,338 -0%
MYSQL With Sentry 500 15% 526 -5%
MYSQL With Sentry (error only) 2,708 81% 2,731 -1%

View base workflow run

@RulaKhaled RulaKhaled changed the title fix(node): Actually check for ai require resolve to enforce the integ… Fix auto-detection race condition in serverless environments Feb 5, 2026
@RulaKhaled RulaKhaled changed the title Fix auto-detection race condition in serverless environments fix(core): Fix auto-detection race condition in serverless environments Feb 5, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

size-limit report 📦

Path Size % Change Change
@sentry/browser 25.43 kB - -
@sentry/browser - with treeshaking flags 23.9 kB - -
@sentry/browser (incl. Tracing) 42.27 kB - -
@sentry/browser (incl. Tracing, Profiling) 46.92 kB - -
@sentry/browser (incl. Tracing, Replay) 80.91 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 70.52 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 85.61 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 97.79 kB - -
@sentry/browser (incl. Feedback) 42.15 kB - -
@sentry/browser (incl. sendFeedback) 30.11 kB - -
@sentry/browser (incl. FeedbackAsync) 35.13 kB - -
@sentry/browser (incl. Metrics) 26.54 kB - -
@sentry/browser (incl. Logs) 26.69 kB - -
@sentry/browser (incl. Metrics & Logs) 27.36 kB - -
@sentry/react 27.14 kB - -
@sentry/react (incl. Tracing) 44.52 kB - -
@sentry/vue 29.87 kB - -
@sentry/vue (incl. Tracing) 44.09 kB - -
@sentry/svelte 25.44 kB - -
CDN Bundle 27.97 kB - -
CDN Bundle (incl. Tracing) 43.04 kB - -
CDN Bundle (incl. Logs, Metrics) 28.82 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 43.87 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 67.75 kB - -
CDN Bundle (incl. Tracing, Replay) 79.8 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 80.67 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 85.23 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 86.13 kB - -
CDN Bundle - uncompressed 81.83 kB - -
CDN Bundle (incl. Tracing) - uncompressed 127.54 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 84.66 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 130.37 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 208.04 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 244.14 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 246.96 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 256.94 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 259.75 kB - -
@sentry/nextjs (client) 46.87 kB - -
@sentry/sveltekit (client) 42.66 kB - -
@sentry/node-core 52.18 kB - -
@sentry/node 166.29 kB -0.01% -7 B 🔽
@sentry/node - without tracing 93.97 kB - -
@sentry/aws-serverless 109.48 kB - -

View base workflow run

@RulaKhaled RulaKhaled changed the title fix(core): Fix auto-detection race condition in serverless environments fix(node): Actually check for ai require resolve to enforce the integraton Feb 5, 2026
@RulaKhaled RulaKhaled changed the title fix(node): Actually check for ai require resolve to enforce the integraton wip fix(node): Actually check for ai require resolve to enforce the integraton Feb 5, 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.

vercelAIIntegration doesn't activate on Vercel deployments without force: true

1 participant