Skip to content

translator: accept reasoning_effort high for Gemini 3 Pro models - #2749

Open
AlSh007 wants to merge 1 commit into
theagentrouter:mainfrom
AlSh007:fix/gemini-pro-reasoning-effort-high
Open

AlSh007 wants to merge 1 commit into
theagentrouter:mainfrom
AlSh007:fix/gemini-pro-reasoning-effort-high

Conversation

@AlSh007

@AlSh007 AlSh007 commented Sep 27, 2026 •

Copy link
Copy Markdown

Description

mapReasoningEffortToThinkingLevel rejects reasoning_effort: "high" for any Gemini 3 model whose name does not contain flash. A Chat Completions request against gemini-3-pro with reasoning_effort: "high" therefore fails with invalid reasoning effort: ... reasoning effort 'high' is only supported for Gemini Flash models before it reaches Vertex, while the same request with medium succeeds and is sent as thinking_level: high.

The guard looks carried over from the none case, where it is correct because only Flash supports the minimal thinking level. For high it is not: Google's thinking docs [1] list high as a supported level for every Gemini 3 model and as the default level for gemini-3-pro-preview and gemini-3.1-pro-preview, the Vertex OpenAI compatibility guide [2] does not restrict it, and the function's own doc comment already says "high" → ThinkingLevelHigh without a model restriction.

This change maps high to ThinkingLevelHigh for all models and adds the Pro case to TestMapReasoningEffortToThinkingLevel and to the openAIReqToGeminiGenerationConfig table. The new rows fail on main with the error above and pass with the fix. go test ./internal/translator/ passes.

AI usage: I used Claude Code [3] to help find the mismatch and draft the change; I reviewed the code and ran the tests locally.

Related Issues/PRs (if applicable)

The guard was introduced in #1844, whose high test only covers gemini-3-flash.

1: https://ai.google.dev/gemini-api/docs/thinking
2: https://docs.cloud.google.com/vertex-ai/generative-ai/docs/start/get-started-with-gemini-3#openai-example
3: https://claude.com/claude-code

mapReasoningEffortToThinkingLevel rejected reasoning_effort "high" for any
Gemini 3 model whose name does not contain "flash", so a Chat Completions
request against gemini-3-pro with reasoning_effort: high failed with an
invalid request body error before reaching Vertex. The guard was carried
over from the "none" case, where it is right because only Flash supports
the minimal thinking level. Google's thinking docs list high as a supported
level for every Gemini 3 model and as the default for the Pro models, and
the function already maps "medium" on Pro to ThinkingLevelHigh.

Map "high" to ThinkingLevelHigh for all models and cover the Pro case in
both the unit table and the generation config table.

AI assistance: Claude was used to help find the mismatch and draft the
change; it was reviewed and tested locally.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: AlSh007 <alok44170@gmail.com>
@AlSh007
AlSh007 requested a review from a team as a code owner September 27, 2026 16:54
@netlify

netlify Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for theagentrouter canceled.

Name Link
🔨 Latest commit db64e4f
🔍 Latest deploy log https://app.netlify.com/projects/theagentrouter/deploys/6ab94a5994191300088e5bdc

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant