Skip to content

feat(cloudflare): Enable AI v7 support for Cloudflare in the /nodejs_compat entrypoint#21917

Open
JPeer264 wants to merge 2 commits into
jp/oxlint-cloudflarefrom
jp/vercelai-7-cloudflare
Open

feat(cloudflare): Enable AI v7 support for Cloudflare in the /nodejs_compat entrypoint#21917
JPeer264 wants to merge 2 commits into
jp/oxlint-cloudflarefrom
jp/vercelai-7-cloudflare

Conversation

@JPeer264

@JPeer264 JPeer264 commented Jul 2, 2026

Copy link
Copy Markdown
Member

re-implementing #21793 with tests, but in the /nodejs_compat entrypoint. The docs will be updated to clarify that AI v7 would only work in this entrypoint. I didn't want to name the integration differently, as then, the "drop-in replacement" would not work properly.

The majority of the PR is tests, and the actual code implementation is just a copy from the base entrypoint including #21793.

Test info

Unfortunately AI v7 cannot be installed as cloudflare-integration-test dependency, as it requires Node v22. It forced me to add 2 e2e-tests instead.

The test matrix is as follows:

  • Vercel AI v6 with nodejs_als (cloudflare-integration-test)
  • Vercel AI v6 with nodejs_compat (cloudflare-integration-test)
  • Vercel AI v7 with nodejs_als (e2e-test, confirming that it doesn't work)
  • Vercel AI v7 with nodejs_compat (e2e-test)

If v7 support would be added by accident to the base entrypoint, then the Vercel AI v6 with nodejs_als will fail. That should have prevented #21793 to exist actually.

@JPeer264 JPeer264 self-assigned this Jul 2, 2026
@JPeer264 JPeer264 requested a review from a team as a code owner July 2, 2026 11:24
@JPeer264 JPeer264 requested review from andreiborza and mydea and removed request for a team July 2, 2026 11:24
@JPeer264 JPeer264 force-pushed the jp/vercelai-7-cloudflare branch from d6415d8 to 32490ef Compare July 2, 2026 11:42
warnings: [],
}),
}),
prompt: 'How much is the fish?',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Image

@andreiborza andreiborza left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice nice nice

@@ -0,0 +1,57 @@
/**
* This is a copy of the Vercel AI integration from the Cloudflare SDK.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This reads a bit confusing, we are in the cloudflare sdk.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ya, I rephrased that 10 times - was never happy. Maybe I specify the entrypoint

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yeah, I'd specify the tracing path, doesn't have to be the exact path of the integration.

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

size-limit report 📦

⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Path Size % Change Change
@sentry/browser 27.59 kB - -
@sentry/browser - with treeshaking flags 26.03 kB - -
@sentry/browser (incl. Tracing) 46.24 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 48 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.01 kB - -
@sentry/browser (incl. Tracing, Replay) 85.49 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 75.1 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 90.19 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 102.84 kB - -
@sentry/browser (incl. Feedback) 44.76 kB - -
@sentry/browser (incl. sendFeedback) 32.38 kB - -
@sentry/browser (incl. FeedbackAsync) 37.51 kB - -
@sentry/browser (incl. Metrics) 28.67 kB - -
@sentry/browser (incl. Logs) 28.91 kB - -
@sentry/browser (incl. Metrics & Logs) 29.59 kB - -
@sentry/react 29.38 kB - -
@sentry/react (incl. Tracing) 48.51 kB - -
@sentry/vue 33.03 kB - -
@sentry/vue (incl. Tracing) 48.11 kB - -
@sentry/svelte 27.61 kB - -
CDN Bundle 30 kB - -
CDN Bundle (incl. Tracing) 48.22 kB - -
CDN Bundle (incl. Logs, Metrics) 31.57 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 49.53 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 70.77 kB - -
CDN Bundle (incl. Tracing, Replay) 85.68 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 86.97 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 91.5 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 92.77 kB - -
CDN Bundle - uncompressed 89.35 kB - -
CDN Bundle (incl. Tracing) - uncompressed 145.92 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 94.05 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 149.89 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 218.59 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 264.93 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 268.89 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 278.63 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 282.58 kB - -
@sentry/nextjs (client) 50.95 kB - -
@sentry/sveltekit (client) 46.65 kB - -
@sentry/core/server 78.37 kB - -
@sentry/core/browser 64.72 kB - -
@sentry/node-core 63.17 kB +0.01% +1 B 🔺
@sentry/node 123.16 kB +0.01% +2 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 69.95 kB - -
@sentry/node/light 50.7 kB - -
@sentry/node - without tracing 74.22 kB - -
@sentry/aws-serverless 85.01 kB - -
@sentry/cloudflare (withSentry) - minified 181.52 kB - -
@sentry/cloudflare (withSentry) 449.12 kB - -

View base workflow run

@JPeer264 JPeer264 force-pushed the jp/oxlint-cloudflare branch from c3abba8 to 670db55 Compare July 3, 2026 09:15
@JPeer264 JPeer264 force-pushed the jp/vercelai-7-cloudflare branch from dd006e2 to 3043f8f Compare July 3, 2026 09:15
@JPeer264 JPeer264 force-pushed the jp/oxlint-cloudflare branch from 670db55 to cd8726f Compare July 3, 2026 09:17
@JPeer264 JPeer264 force-pushed the jp/vercelai-7-cloudflare branch from 3043f8f to 73e8b22 Compare July 3, 2026 09:17
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