Skip to content

Azure provider: reasoningEffort model option silently ignored #20275

Closed

Description

@meruiden

Description

When using @ai-sdk/azure as a custom provider with model-level options like reasoningEffort, the option is silently dropped — reasoning_effort never appears in the outgoing HTTP request body.

Steps to reproduce

  1. Configure a custom Azure OpenAI provider with a model that sets reasoningEffort:
{
  "provider": {
    "my-azure": {
      "npm": "@ai-sdk/azure",
      "options": { "baseURL": "https://my-endpoint.openai.azure.com" },
      "models": {
        "gpt-5.1-high": {
          "id": "gpt-5.1",
          "options": { "reasoningEffort": "high" }
        }
      }
    }
  }
}
  1. Send a request and inspect the outgoing HTTP body
  2. reasoning_effort is missing from the request

Root cause

In packages/opencode/src/provider/transform.ts, sdkKey("@ai-sdk/azure") returns "azure", so model options are wrapped as providerOptions["azure"].

However, @ai-sdk/azure delegates to OpenAIChatLanguageModel from @ai-sdk/openai, which hardcodes provider: 'openai' in parseProviderOptions — meaning it only reads from providerOptions["openai"].

The options end up under the wrong key and are silently ignored.

Expected behavior

reasoning_effort (and other model options) should be included in the request body when configured on an Azure provider model.

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 31, 2026
  2. github-actions commented on Mar 31, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  3. changed the title [-]Azure provider: reasoningEffort model option silently ignored since v1.3.4[/-] [+]Azure provider: reasoningEffort model option silently ignored[/+] on Mar 31, 2026
  4. added a commit that references this issue on Mar 31, 2026
    7e869d3
  5. rekram1-node commented on Mar 31, 2026

    @rekram1-node
    Collaborator

    this may have fixed it:
    4dd866d

  6. meruiden commented on Apr 1, 2026

    @meruiden
    ContributorAuthor

    Thanks for looking into this @rekram1-node!

    I checked commit 4dd866d and it addresses a different issue — it removes the @ai-sdk/azure exclusion from the message-level providerOptions remapping (line ~295 in transform.ts). That fix ensures message/part-level options get remapped from a custom provider name to the SDK key.

    However, the reasoningEffort bug is in sdkKey() itself (line 29), which controls the model-level providerOptions key — the one used when passing options like reasoningEffort to streamText(). sdkKey("@ai-sdk/azure") still returns "azure", but OpenAIChatLanguageModel from @ai-sdk/openai hardcodes provider: 'openai' in parseProviderOptions, so it only reads from providerOptions["openai"].

    I verified on the latest dev branch (with that commit included) that reasoning_effort is still missing from the outgoing request body when using an Azure provider with "options": { "reasoningEffort": "medium" }.

    The fix in #20272 (changing sdkKey to return "openai" for @ai-sdk/azure) is still needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions