Skip to content

Commit ae2ec36

Browse files
meruidenclaude
andcommitted
fix: pass both "openai" and "azure" providerOptions keys for @ai-sdk/azure
`@ai-sdk/azure` delegates to `OpenAIChatLanguageModel` from `@ai-sdk/openai`, which hardcodes `provider: 'openai'` when calling `parseProviderOptions` — so it only reads model options from `providerOptions["openai"]`. Meanwhile, `OpenAIResponsesLanguageModel` checks `providerOptions["azure"]` first, falling back to `"openai"`. Previously, `providerOptions()` only passed options under the `"azure"` key (via `sdkKey`), which meant model options like `reasoningEffort` were silently ignored on the chat completions path. Fix: for `@ai-sdk/azure`, pass options under both `"openai"` and `"azure"` keys so they are picked up by both the Chat and Responses model implementations. This avoids changing `sdkKey()`, which is also used for message-level providerOptions remapping where `"azure"` is the correct key. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 506dd75 commit ae2ec36

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/opencode/src/provider/transform.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -936,6 +936,12 @@ export namespace ProviderTransform {
936936
}
937937

938938
const key = sdkKey(model.api.npm) ?? model.providerID
939+
// @ai-sdk/azure delegates to OpenAIChatLanguageModel which reads from
940+
// providerOptions["openai"], but OpenAIResponsesLanguageModel checks
941+
// "azure" first. Pass both so model options work on either code path.
942+
if (model.api.npm === "@ai-sdk/azure") {
943+
return { openai: options, azure: options }
944+
}
939945
return { [key]: options }
940946
}
941947

0 commit comments

Comments
 (0)