fix(cloudflare): Prevent AI provider skips - #22719
Merged
Merged
Conversation
JPeer264
requested review from
andreiborza and
isaacs
and removed request for
a team
July 27, 2026 16:50
Contributor
size-limit report 📦
|
andreiborza
approved these changes
Jul 28, 2026
andreiborza
left a comment
Member
There was a problem hiding this comment.
LGTM but an integration or e2e test would be nicer for validating the skips. As is feels a bit contrived, but feel free to ignore if you're confident this all works.
Comment on lines
+70
to
+71
| // TODO(v11): export the constant from server-utils and import it here instead. | ||
| const WORKERS_AI_INTEGRATION_NAME = 'WorkersAI'; |
Member
There was a problem hiding this comment.
q: Why is this a todo? Can't we do that now? We are in v11.
Member
Author
There was a problem hiding this comment.
Yes we can. I just wanted to keep things easier for backports for now.
Member
Author
There was a problem hiding this comment.
In a follow up I can move everything over to server-utils
Member
Author
For now integration nor e2e tests would be valuable as |
JPeer264
added a commit
that referenced
this pull request
Jul 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When running on
agentsor any other SDK on Cloudflare it could be that users use Vercel AI. When this happens it could be thatworkers-aiandaispans are generating two spans for LLM calls. With_INTERNAL_skipAiProviderWrappingwe can actually prevent this from happening: https://sentry-sdks.sentry.io/explore/traces/trace/e532a314e3b745de974f2b04cd745975/