Skip to content

test(provider): guarantee @ai-sdk/openai defaults to responses#28432

Open
vegerot wants to merge 1 commit into
anomalyco:devfrom
vegerot:vegerot/openai-responses-language-model-test
Open

test(provider): guarantee @ai-sdk/openai defaults to responses#28432
vegerot wants to merge 1 commit into
anomalyco:devfrom
vegerot:vegerot/openai-responses-language-model-test

Conversation

@vegerot
Copy link
Copy Markdown

@vegerot vegerot commented May 20, 2026

Issue for this PR

Closes #28535

Type of change

  • 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

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Copilot AI review requested due to automatic review settings May 20, 2026 05:23
@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label May 20, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.effect test asserting languageModel() resolves to the .responses provider by default for @ai-sdk/openai.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/core/test/plugin/provider-openai.test.ts
@vegerot vegerot force-pushed the vegerot/openai-responses-language-model-test branch from 1dcaa66 to 4d75537 Compare May 20, 2026 05:28
@github-actions github-actions Bot removed needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels May 20, 2026
@github-actions
Copy link
Copy Markdown
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>
@vegerot vegerot force-pushed the vegerot/openai-responses-language-model-test branch from 508a245 to f21dd1e Compare May 20, 2026 05:32
Sign up for free to 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.

Missing test coverage to prove @ai-sdk/openai uses Responses API on custom providers

2 participants