Repository navigation
Labels
ai/providerrelated to a provider package. Must be assigned together with at least one `provider/*` labelrelated to a provider package. Must be assigned together with at least one `provider/*` labelbugSomething isn't working as documentedSomething isn't working as documentedmerged-mainprovider/openai-compatibleIssues related to the @ai-sdk/openai-compatible providerIssues related to the @ai-sdk/openai-compatible providertask-identify-issue-type-done
Description
Description
When using openai-compatible provider and specifying the reasoningEffort option, both reasoning_effort and reasoningEffort fields appear in the request body, with the latter being redundant. Some providers will raise an error due to this.
providerOptions: {
'provider-name': { reasoningEffort: 'low' }
}
When specifying reasoning_effort directly instead of reasoningEffort, both fields in the request body disappear:
providerOptions: {
'provider-name': { reasoning_effort: 'low' }
}
The key of the problem should be here:
ai/packages/openai-compatible/src/chat/openai-compatible-chat-language-model.ts
Lines 186 to 192 in 8d6d8d7
| seed, | |
| ...providerOptions?.[this.providerOptionsName], | |
| reasoning_effort: compatibleOptions.reasoningEffort, | |
| // messages: | |
| messages: convertToOpenAICompatibleChatMessages(prompt), |
There should be a way to add only the reasoning_effort field to the request body
AI SDK Version
- ai: 5.0.22
- @ai-sdk/openai-compatible: 1.0.11
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
ai/providerrelated to a provider package. Must be assigned together with at least one `provider/*` labelrelated to a provider package. Must be assigned together with at least one `provider/*` labelbugSomething isn't working as documentedSomething isn't working as documentedmerged-mainprovider/openai-compatibleIssues related to the @ai-sdk/openai-compatible providerIssues related to the @ai-sdk/openai-compatible providertask-identify-issue-type-done
Activity
jessevdp commentedon Sep 1, 2025
I just ran into this issue and concluded the same.
It seems that the
reasoningEffortoption ends up next to thereasoning_effortoption because of spread on line 187.fix(openai-compatible): prevent redundant reasoningEffort alongside r…
fix(openai-compatible): prevent redundant reasoningEffort alongside r…
fix(openai-compatible): prevent redundant reasoningEffort alongside r…
gr2m commentedon Sep 2, 2025
Thanks @jessevdp for fixing it! I'll get the fix released later today
fix(openai-compatible): prevent redundant reasoningEffort field (verc…
lgrammel commentedon Jul 22, 2026
Identify issue type
Identified as Bug
Confidence: High
Rationale
This is a concrete request-serialization defect in existing provider behavior, confirmed by reproduction details and a subsequent fix.
Evidence
reasoningEffortwith@ai-sdk/openai-compatible1.0.11 sends bothreasoningEffortandreasoning_effortin the request body.