fix(openai): Set Auto Reasoning effort to Medium#8211
Merged
justin-tahara merged 2 commits intomainfrom Feb 6, 2026
Merged
Conversation
Contributor
Greptile OverviewGreptile SummaryThis PR fixes an issue where GPT-5.2 chat models reject "low" as a valid reasoning effort level. The fix changes the default Changes:
The changes are consistent, well-tested, and align with the PR description which states the issue was tested against both 4-series and 5-series models. Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Client
participant LitellmLLM
participant ReasoningEffort
participant OpenAI API
Client->>LitellmLLM: stream(messages, reasoning_effort=AUTO)
LitellmLLM->>LitellmLLM: Check if reasoning model
alt GPT-5 chat model (contains "-chat")
LitellmLLM->>ReasoningEffort: Map AUTO → "medium"
LitellmLLM->>LitellmLLM: Skip reasoning params (OpenAI bug)
LitellmLLM->>LitellmLLM: Set reasoning_effort="medium"
else GPT-5 non-chat reasoning model
LitellmLLM->>ReasoningEffort: Map AUTO → "medium"
LitellmLLM->>LitellmLLM: Set reasoning.effort="medium"
else Other reasoning models
LitellmLLM->>LitellmLLM: Use fallback MEDIUM
LitellmLLM->>LitellmLLM: Set reasoning_effort="medium"
end
LitellmLLM->>OpenAI API: completion(reasoning_effort="medium")
OpenAI API-->>LitellmLLM: Response stream
LitellmLLM-->>Client: Model responses
|
yuhongsun96
approved these changes
Feb 6, 2026
1ad3adc to
9148bce
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.
Description
There is an issue where Chat GPT 5.2 will not accept low as a valid level of reasoning so working on cleaning this up to ensure that we are properly setting the correct reasoning level for the model.
How Has This Been Tested?
Ran locally and tested against 4 series for regular, mini and pro
Ran locally and tested against 5 series for regular, mini and pro
Additional Options
Summary by cubic
Sets the default reasoning level for OpenAI GPT-5.2 chat models to “medium” when “auto” is requested, and uses “medium” as the fallback. This prevents API errors and keeps requests compatible with 5.2 reasoning models.
Written for commit 9148bce. Summary will update on new commits.