Skip to content

test(cloudflare): Proof that AI providers work OOTB on Cloudflare - #22313

Merged
JPeer264 merged 1 commit into
developfrom
jp/vercel-ai-cloudflare
Jul 16, 2026
Merged

test(cloudflare): Proof that AI providers work OOTB on Cloudflare#22313
JPeer264 merged 1 commit into
developfrom
jp/vercel-ai-cloudflare

Conversation

@JPeer264

Copy link
Copy Markdown
Member

The Cloudflare integration tests were already testing all AI integrations, but used mocks.

I changed the following in all tests:

  • Removed the mocks.ts and changed it to the actual package
    • Instead the .fetch is being mocked
  • Aligned the assertions

@JPeer264JPeer264 self-assigned this Jul 16, 2026
@JPeer264
JPeer264 requested a review from a team as a code ownerJuly 16, 2026 08:59
@JPeer264
JPeer264 requested review from andreiborza, isaacs and mydea and removed request for a teamJuly 16, 2026 08:59

@cursorcursorBot 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 10d6264. Configure here.

[GEN_AI_USAGE_INPUT_TOKENS_ATTRIBUTE]: { value: 10, type: 'integer' },
[GEN_AI_USAGE_OUTPUT_TOKENS_ATTRIBUTE]: { value: 15, type: 'integer' },
[GEN_AI_USAGE_TOTAL_TOKENS_ATTRIBUTE]: { value: 25, type: 'integer' },
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Broken exact span assertions

High Severity

The new exact toEqual checks on streamed AI spans only list gen-ai attributes. Streamed spans also get common fields from applyCommonSpanAttributes (sentry.trace.lifecycle, sentry.segment.*, sentry.sdk.*, sentry.release, sentry.environment), so these assertions fail. The langchain suite has the same issue.

Additional Locations (2)
Fix in CursorFix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

Reviewed by Cursor Bugbot for commit 10d6264. Configure here.

const url = typeof input === 'string' ? input : input instanceof URL ? input.href : input.url;

const client: GoogleGenAIClient = Sentry.instrumentGoogleGenAIClient(mockClient);
if (!url.includes('generativelanguage.googleapis.com')) {

@Lms24Lms24 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.

Good change! This much more respects the "integration" in "integration tests" :D

@nicohrubecnicohrubec 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.

nicee

@JPeer264
JPeer264force-pushed the jp/vercel-ai-cloudflare branch from 10d6264 to 75f5b8aCompareJuly 16, 2026 11:04
@JPeer264
JPeer264 merged commit ea5a462 into developJul 16, 2026
45 of 46 checks passed
@JPeer264
JPeer264 deleted the jp/vercel-ai-cloudflare branch July 16, 2026 19:26
Sign up for freeto 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.

4 participants

@JPeer264@Lms24@nicohrubec@github-advanced-security