Repository navigation
chore(ai): rename the openai-compatible provider options key - #186
Merged
Merged
Conversation
AI SDK 7 deprecates the kebab-case `providerOptions` key for `@ai-sdk/openai-compatible`. The provider still reads it, but it logs a deprecation warning on every call and files `providerMetadata` under the old key. The constant already served as both the provider name and the options key, so it now holds the camelCase form and both follow from it. Verified against the real provider with a capturing fetch, same request in all three cases: key='openai-compatible' reasoning_effort=low + DeprecationWarning key='openaiCompatible' reasoning_effort=low (no warning) key=<none> no reasoning field Nothing in this repository reads `providerMetadata` (a repository-wide search for it in `src/` returns nothing), so moving the key from `providerMetadata['openai-compatible']` to `providerMetadata['openaiCompatible']` has no UI, logging or debug consumer. `test/connectionCapabilities.test.ts` now pins the metadata key anyway, through a mocked SSE response, so a revert to the deprecated key fails a test instead of only warning. Verified: typecheck clean, 472/472 tests pass, `npm run build` OK. No dependency, native addon, packaging or schema change, so no packaged smoke was needed.
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.
What
One constant:
PROVIDER_OPTIONS_KEY'openai-compatible'→'openaiCompatible'.AI SDK 7 deprecates the kebab-case
providerOptionskey for@ai-sdk/openai-compatible. The provider still reads it, but it logs a deprecation warning on every call and filesproviderMetadataunder the old key.The constant already served as both the provider
nameand the options key, and the provider derives the metadata key from whichever key the caller sends, so one change keeps all three consistent:Verification: real provider, captured fetch, three cases
Not a constant test — the actual request body and the actual warning stream:
Behaviour is unchanged and the warning is gone. The reasoning configuration still reaches the request as
reasoning_effort.The
providerMetadataconsequence, coveredBecause the provider namespaces
providerMetadataby the options key, this movesproviderMetadata['openai-compatible']→providerMetadata['openaiCompatible']. Two things make that safe, and the second is a test rather than a promise:A repository-wide search for
providerMetadatainsrc/returns nothing — no UI, logging or debug consumer depends on either key.test/connectionCapabilities.test.tsnow drives the real provider through a mocked SSE response and asserts:plus that the constant is literally
openaiCompatible. Reverting to the deprecated key now fails a test instead of only emitting a warning.Scope
Only
src/main/models/protocols/openaiCompletions.tsand its test.name,baseURLandapiKeyare untouched; the provider id and request shape do not change.Verified
npm run typecheck— cleannpm test— 472/472 pass (471 + the metadata-shape test)npm run build— OKNo dependency, native addon, packaging or schema change, so no packaged smoke — agreed with the reviewer, and consistent with CONTRIBUTING's rule (packaged checks are for Electron main/preload,
dependencies, native addons, packaging, DB init or build config).Follow-up
The
streamObjectdeprecation migration is next, separately, and not stacked on this: characterization tests forQuizService/AnkiCardService/MindMapServicefirst (partial-object order and visibility, progress callback count and timing, the final object, provider-error propagation, abort behaviour), then the migration.