Description
Problem
When using @ai-sdk/openai-compatible provider (e.g. LiteLLM proxy) with GPT-5.x models, opencode auto-injects reasoningSummary: "auto" into provider options. LiteLLM does not recognize this parameter and returns:
litellm.BadRequestError: OpenAIException - Unknown parameter: 'reasoningSummary'
Root Cause
In packages/opencode/src/provider/transform.ts, the options() function checks input.model.api.id.includes("gpt-5") and unconditionally sets reasoningSummary: "auto" regardless of the npm provider package:
if (input.model.api.id.includes("gpt-5") && !input.model.api.id.includes("gpt-5-chat")) {
if (!input.model.api.id.includes("gpt-5-pro")) {
result["reasoningEffort"] = "medium";
result["reasoningSummary"] = "auto"; // <-- injected for ALL providers
}
}The variants() function correctly scopes reasoningSummary to only @ai-sdk/openai, @ai-sdk/azure, and @ai-sdk/github-copilot — but options() does not.
Why it can't be worked around via config
- Setting
"reasoningSummary": nullin modeloptionsdoes not help —mergeDeep(remeda) preservesnull, and@ai-sdk/openai-compatiblesends it in the request body. - Setting
"reasoningSummary": undefineddoes not help —mergeDeepskipsundefined, so the base value"auto"remains. - There is no config-level way to delete a key injected by the base
options().
Expected Behavior
reasoningSummary should only be injected for providers that support it (@ai-sdk/openai, @ai-sdk/azure, @ai-sdk/github-copilot), consistent with how variants() already handles this.
Suggested Fix
Wrap the reasoningSummary assignment in options() with a provider check:
if (["@ai-sdk/openai", "@ai-sdk/azure", "@ai-sdk/github-copilot"].includes(input.model.api.npm)) {
result["reasoningSummary"] = "auto";
}Config
{
"provider": {
"litellm": {
"npm": "@ai-sdk/openai-compatible",
"models": {
"gpt-5.4": {
"name": "gpt-5.4",
"limit": { "context": 1050000, "output": 128000 }
}
}
}
}
}Environment
- opencode v1.4.3 (Homebrew, compiled Bun binary)
- LiteLLM proxy as OpenAI-compatible backend
Activity
nazarhnatyshen commentedon Apr 13, 2026
Closing as duplicate of #21237 and #18882
github-actions commentedon Apr 13, 2026
This issue might be a duplicate of existing issues. Please check:
reasoningSummaryinjected foropenai-compatibleproviders that don't support itUnknown parameter: 'reasoningSummary'on GPT-5.x modelsPlease check if any of these already cover your report. If so, consider closing this one and adding a comment there instead.