-
Notifications
You must be signed in to change notification settings - Fork 85
chore(deps-dev): bump @ai-sdk/openai from 2.0.20 to 3.0.50 #782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴 This PR bumps @ai-sdk/openai from 2.x to 3.x, but the companion
aipackage remains at ^5 — these are incompatible: @ai-sdk/openai@3.0.50 depends on @ai-sdk/provider@3.0.8 and @ai-sdk/provider-utils@4.0.22, while ai@5.0.52 depends on @ai-sdk/provider@2.0.0 and @ai-sdk/provider-utils@3.0.9. All e2e tests in vercel-ai-sdk.e2e.test.ts that pass an openai() model to generateText/streamText/generateObject/streamObject/embed will fail at runtime due to the incompatible LanguageModel protocol across these major versions. Fix by also bumping ai to ^6 or ^7 (the versions @ai-sdk/openai@3.x was designed for, as shown in the PR release notes listing ai@7.0.0-beta.77/78), or revert @ai-sdk/openai to ^2.Extended reasoning...
Root cause
This Dependabot PR bumps
@ai-sdk/openaifrom2.0.20to3.0.50in devDependencies, but leavesaipinned at^5(resolving toai@5.0.52). These two packages share a common provider interface contract, and the versions are incompatible:@ai-sdk/openai@3.0.50depends on@ai-sdk/provider@3.0.8and@ai-sdk/provider-utils@4.0.22ai@5.0.52depends on@ai-sdk/provider@2.0.0and@ai-sdk/provider-utils@3.0.9The pnpm lockfile confirms both major versions are installed side-by-side (not deduplicated), since they have different major versions and are not peer-resolved.
Incompatible interface versions
The
@ai-sdk/providerpackage defines theLanguageModelprotocol (the interface thatgenerateText(),streamText(),generateObject(), andstreamObject()call into). A major version bump from 2.x to 3.x indicates breaking interface changes. The addition of@standard-schema/spec@1.1.0as a new required dependency in@ai-sdk/provider-utils@4.0.22(absent from 3.x) specifically indicates breaking changes in schema handling — directly affectinggenerateObject,streamObject, and tool definitions.Code path that triggers it
In
tests/e2e/vercel-ai-sdk.e2e.test.ts, the tests do:At runtime,
generateText()(fromai@5.x) will call methods on the model object using theLanguageModelV1interface defined in@ai-sdk/provider@2.x. If@ai-sdk/openai@3.xexposes aLanguageModelV2(or otherwise changedspecificationVersion/doGenerate/doStream/doEmbedsignatures), the call will fail.Confirmation from release notes
The PR's own release notes show that
@ai-sdk/openai@3.xwas released alongsideai@7.0.0-beta.77andai@7.0.0-beta.78— meaning it was designed forai@6.xorai@7.x, notai@5.x.@ai-sdk/anthropicwas intentionally NOT bumped and stays at^2, compatible withai@5.x, highlighting this as an accidental mismatch.Step-by-step proof
pnpm installresolves@ai-sdk/openaito3.0.50, which hard-depends on@ai-sdk/provider@3.0.8ai@5.0.52hard-depends on@ai-sdk/provider@2.0.0— these cannot deduplicate across a major version boundarynode_modules/@ai-sdk/openai/node_modules/@ai-sdk/provideris v3.x;node_modules/ai/node_modules/@ai-sdk/provideris v2.xopenai("gpt-4o-mini")→ returns an object implementingLanguageModelfromprovider@3.xgenerateText({ model: ... })fromai@5.x, which checksmodel.specificationVersionor callsmodel.doGenerate()per theprovider@2.xAPI contractFix
Either:
aifrom^5to^6or^7alongside this PR (matching what@ai-sdk/openai@3.xwas designed for)@ai-sdk/openaito^2and wait for a coordinated upgrade