Skip to content

[BUG] options.reasoningEffort not passed to API calls for custom @ai-sdk/openai provider #20815

@hhieuu

Description

@hhieuu

Description

Starting from v1.3.4, options.reasoningEffort plus options.reasoningSummary, and by extension variants.<name>.reasoningEffort plus variants.<name>.reasoningSummary, configured in opencode.json is no longer passed on to API calls when @ai-sdk/openai provider is used as the NPM SDK for a custom provider. The option still works with v1.3.3, so I believe this regression is introduced with the move to AI SDK v6.

The documentation for the OpenAI SDK supports the use of reasoningEffort and reasoningSummary: docs here. This effectively make GPT 5.4 and GPT 5.3 Codex on custom provider mostly unusable.

Plugins

No response

OpenCode version

1.3.13, but this regression appears first on 1.3.4 and forward.

Steps to reproduce

  1. Create a custom provider in config against a custom Responses API compatible provider. Example:
{
  "provider": {
    "my_provider": {
      "my_model": {
        "npm": "@ai-sdk/openai provider",
        "name": "My Custom Provider",
        "options": {
          "baseURL": "https://custom-openai-compatible-url/v1",
          "apiKey": "sk-my-api-key"
        },
        "models": {
          "gpt-5.3-codex": {
            "name": "gpt-5.3-codex",
            "options": {
              "include": ["reasoning.encrypted_content"], // included in request body
              "reasoningEffort": "high", // NOT included in request body
              "reasoningSummary": "auto", // NOT included in request body
              "textVerbosity": "medium" // included in request body
            }
          },
          "gpt-5.4": {
            "name": "gpt-5.3-codex",
            "options": {
              "include": ["reasoning.encrypted_content"] // included in request body
            },
            "variants": {
              "high": {
                "reasoningEffort": "high", // NOT included in request body
                "reasoningSummary": "auto", // NOT included in request body
                "textVerbosity": "medium" // included in request body
              }
            }
          }
        }
      }
    }
  }
}
  1. Make a simple request in OpenCode with either model.
  2. Intercept and inspect the request body

Expect: Reasoning effort and summary is included in the request body as below.

{
  ...
  "reasoning": {
    "effort": "high",
    "summary": "auto"
  },
  ...
}

Observed: "reasoning" is not added into the request body -> bug.

Screenshot and/or share link

reasoningEffort and reasoningSummary usage docs here

Operating System

Linux

Terminal

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreAnything 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