fix(provider-utils): RFC 9110 compliant User-Agent header format#12945
Open
giulio-leone wants to merge 1 commit intovercel:mainfrom
Open
fix(provider-utils): RFC 9110 compliant User-Agent header format#12945giulio-leone wants to merge 1 commit intovercel:mainfrom
giulio-leone wants to merge 1 commit intovercel:mainfrom
Conversation
92c3ff2 to
93445f7
Compare
Author
|
Intervention note for this PR: Current blocker appears to be Vercel deployment authorization, not code/test correctness. Observed pattern:
Recommended unblock sequence:
If useful, I can follow up with a PR-by-PR status sweep after authorization is completed. |
Author
|
This PR is ready for review — all CI checks pass, no merge conflicts, and all review threads have been resolved. Ready to merge when approved. 🚀 |
The generated User-Agent header contained invalid product tokens per RFC 9110 §10.1.5: - ai-sdk/provider-utils/4.0.15: slash in product name - runtime/bun/1.3.9: nested slash in product-version (from Bun UA) Now produces RFC-compliant tokens: - ai-sdk-provider-utils/4.0.15 - runtime-bun/1.3.9 Fixes vercel#12799
93445f7 to
ab92248
Compare
Author
|
Hi! Gentle ping — this PR is rebased on main, CI passes, and ready for review. Happy to address any feedback. Thanks! |
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.
Summary
Fixes #12799
The generated
User-Agentheader contained invalid product tokens per RFC 9110 §10.1.5, causing Azure OpenAI to reject all requests with HTTP 400 when running on Bun.Root Cause
Two violations:
ai-sdk/provider-utils/4.0.15— The product nameai-sdk/provider-utilscontains a/, which is only allowed as the separator between product name and version. This makesprovider-utils/4.0.15parse as an invalid product-version.runtime/bun/1.3.9— Bun exposesnavigator.userAgent = 'Bun/1.3.9'. Wrapping inruntime/${...}producesruntime/bun/1.3.9with a nested/in the product-version.RFC 9110 defines:
Changes
get-runtime-environment-user-agent.ts: Parsenavigator.userAgentto split product/version (e.g.Bun/1.3.9→runtime-bun/1.3.9). Also fix Node.js path fromruntime/node.js/toruntime-node/.post-to-api.ts+get-from-api.ts: Changedai-sdk/provider-utils/→ai-sdk-provider-utils/(replace/with-in product name).Before / After
ai-sdk/provider-utils/4.0.15ai-sdk-provider-utils/4.0.15runtime/bun/1.3.9runtime-bun/1.3.9runtime/node.js/v22.0.0runtime-node/v22.0.0