fix: use camelCase reasoningEffort for Gemini 3 models in openai-compatible provider#13228
Merged
kangfenmao merged 1 commit intomainfrom Mar 5, 2026
Merged
fix: use camelCase reasoningEffort for Gemini 3 models in openai-compatible provider#13228kangfenmao merged 1 commit intomainfrom
kangfenmao merged 1 commit intomainfrom
Conversation
…atible provider The AI SDK's openai-compatible provider schema only recognizes camelCase `reasoningEffort`, not snake_case `reasoning_effort`. When snake_case was passed, the SDK's explicit mapping overrode it with `undefined`, silently dropping the parameter from HTTP requests. Closes #13221 Co-Authored-By: Claude Opus 4.6 <[email protected]>
eeee0717
approved these changes
Mar 5, 2026
kangfenmao
approved these changes
Mar 5, 2026
|
Note This comment was translated by Claude. The openai-response API has the same issue, it also doesn't pass parameters. Original Contentopenai-response api 也有同样的问题,也没传参 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does
Before this PR:
Gemini 3 models (e.g.,
gemini-3-flash-preview) did not include thereasoning_effortparameter in HTTP requests when deep thinking mode was enabled through OpenAI Compatible providers. The parameter was silently dropped.After this PR:
Gemini 3 models correctly send the
reasoning_effortparameter when using OpenAI Compatible providers.Fixes #13221
Why we need it and why it was done in this way
The AI SDK's
@ai-sdk/openai-compatibleprovider schema only recognizes camelCasereasoningEffort, not snake_casereasoning_effort. When snake_case was passed via provider options, it failed schema validation. The SDK then explicitly mappedreasoning_effort: compatibleOptions.reasoningEffortin the request body, which resolved toundefined(since the schema rejected the snake_case key), overriding any spread value and silently dropping the parameter.The fix changes the return value from
{ reasoning_effort: reasoningEffort }to{ reasoningEffort }(camelCase) so the AI SDK schema recognizes it and properly maps it toreasoning_effortin the HTTP request body.The following tradeoffs were made: N/A
The following alternatives were considered: Patching the AI SDK to accept snake_case — rejected because it's a third-party dependency and the camelCase format is the documented API.
Breaking changes
None
Special notes for your reviewer
The existing comment in
src/renderer/src/types/sdk.ts(line 82) already warns about this exact behavior:// WARN: This field will be overwrite to undefined by aisdk if the provider is openai-compatible. Use reasoningEffort instead.Checklist
Release note