test(provider): guarantee @ai-sdk/openai defaults to responses#28432
Open
vegerot wants to merge 1 commit into
Open
test(provider): guarantee @ai-sdk/openai defaults to responses#28432vegerot wants to merge 1 commit into
vegerot wants to merge 1 commit into
Conversation
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a regression test to ensure the @ai-sdk/openai languageModel() defaults to the OpenAI Responses API provider variant when triggered through OpenAIPlugin.
Changes:
- Adds a new
it.effecttest assertinglanguageModel()resolves to the.responsesprovider by default for@ai-sdk/openai.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1dcaa66 to
4d75537
Compare
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
### Issue for this PR Closes anomalyco#28433 ### Type of change - [x] Bug fix - [ ] New feature - [ ] Refactor / code improvement - [ ] Documentation ### What does this PR do? Adds a regression test proving that `@ai-sdk/openai` keeps the default `languageModel()` path on the Responses API. This matters for me and other OpenCode developers because custom provider work often uses provider IDs other than `openai` while still relying on `@ai-sdk/openai` under the hood. OpenCode has an explicit `responses()` override for the built-in `openai` provider, but custom providers fall back to `sdk.languageModel(...)`. Without this guarantee in the test suite, a future SDK or integration change could silently move custom OpenAI-backed providers onto the wrong protocol and break proxy/provider integrations in a way that is easy to miss in review. ### How did you verify your code works? Ran: - `bun test test/plugin/provider-openai.test.ts` The new test asserts that a custom provider created with `@ai-sdk/openai` resolves `languageModel("gpt-5")` to the `.responses` provider path. ### Screenshots / recordings N/A ### Checklist - [x] I have tested my changes locally - [x] I have not included unrelated changes in this PR Co-authored-by: OpenCode <opencode@users.noreply.github.com>
508a245 to
f21dd1e
Compare
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.
Issue for this PR
Closes #28535
Type of change
What does this PR do?
Adds a regression test proving that
@ai-sdk/openaikeeps the defaultlanguageModel()path on the Responses API.This matters for me and other OpenCode developers because custom provider work often uses provider IDs other than
openaiwhile still relying on@ai-sdk/openaiunder the hood. OpenCode has an explicitresponses()override for the built-inopenaiprovider, but custom providers fall back tosdk.languageModel(...). Without this guarantee in the test suite, a future SDK or integration change could silently move custom OpenAI-backed providers onto the wrong protocol and break proxy/provider integrations in a way that is easy to miss in review.How did you verify your code works?
Ran:
bun test test/plugin/provider-openai.test.tsThe new test asserts that a custom provider created with
@ai-sdk/openairesolveslanguageModel("gpt-5")to the.responsesprovider path.Screenshots / recordings
N/A
Checklist