fix(openai): support gpt-5.6 reasoning_effort with function tools - #7169
Open
vishal27shetty wants to merge 1 commit into
Open
fix(openai): support gpt-5.6 reasoning_effort with function tools#7169vishal27shetty wants to merge 1 commit into
vishal27shetty wants to merge 1 commit into
Conversation
vishal27shetty
force-pushed
the
fix/gpt-5-6-reasoning-effort
branch
from
September 8, 2026 10:22
61bb8ae to
11cb441
Compare
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.
Problem
gpt-5.6,gpt-5.6-luna,gpt-5.6-sol, andgpt-5.6-terraaren't inChatModelsor_supports_reasoning_effort(), so the plugin doesn't recognize them as reasoning models at all.This causes two independent 400s from OpenAI. First, an unspecified
reasoning_effortfallsthrough to the
"minimal"default, which this family rejects outright, tools or not:Unsupported value: 'reasoning_effort' does not support 'minimal' with this model.
Supported values are: 'none', 'low', 'medium', 'high', 'xhigh'.
Second, once function tools are attached, gpt-5.6 requires
reasoning_effortto be explicitly"none"— omitting the parameter also 400s, unlike gpt-5.2/gpt-5.4, which just need it absent:Function tools with reasoning_effort are not supported for gpt-5.6-luna in
/v1/chat/completions. To use function tools, use /v1/responses or set
reasoning_effort to 'none'.
Changes
models.py: register the 4 gpt-5.6 variants inChatModelsand_supports_reasoning_effort;add
_REASONING_EFFORT_NONE_MODELS, the set of models whose correct default is"none".llm.py: use_REASONING_EFFORT_NONE_MODELSfor default selection (previously a hardcodedlist missing gpt-5.6); add
_REASONING_EFFORT_TOOL_REQUIRES_NONE_MODELSand forcereasoning_effort="none"at request time when tools are attached, scoped to gpt-5.6 only.responses/llm.py: same default-selection fix — the Responses API already accepts tools withany
reasoning_effortvalue, verified live, so no coercion is needed there.Testing
Live against the OpenAI API across all 8 affected models (gpt-5.1, gpt-5.2, gpt-5.4,
gpt-5.4-mini, and all 4 gpt-5.6 variants), with function tools attached, both with no
reasoning_effortset and with an explicit override — 16/16 passing. Confirmed_REASONING_EFFORT_TOOL_REQUIRES_NONE_MODELScontains only the 4 gpt-5.6 models by inspectingit directly at runtime; gpt-5.1/5.2/5.4/5.4-mini are unaffected.