add gpt5 models to models without temperature support #2116
+3
−0
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.
User description
Hi all,
This patches this issue: #1985
A bit more context on this:
I am running pr-agent 0.3.0
Model" gpt-5.1-codex-mini
the "improve" tool was failing with following error:
Error during LLM inference: litellm.BadRequestError: OpenAIException - Unsupported value: 'temperature' does not support 0.2 with this model. Only the default (1) value is supported.
and following warnings were present even after I would set config__temperature=1:
2025-11-20 12:58:29.977 | WARNING | pr_agent.algo.ai_handlers.litellm_ai_handler:chat_completion:378 - Error during LLM inference: litellm.BadRequestError: OpenAIException - Unsupported value: 'temperature' does not support 0.2 with this model. Only the default (1) value is supported.
I did trace it to this list https://github.com/qodo-ai/pr-agent/blob/main/pr_agent/algo/__init__.py#L185 and if the model was added there the "improve" tool would work
PS I think all gpt-5 series models do not support temperature anymore (gpt-5, gpt-5-mini, gpt-5.1-codex, gpt-5.1-codex-mini, the list goes on)
Best, Dzmitry
PR Type
Bug fix
Description
Add GPT-5 series models to temperature-unsupported list
Fixes LLM inference errors when using gpt-5.1-codex variants
Prevents temperature parameter from being sent to incompatible models
Diagram Walkthrough
File Walkthrough
__init__.py
Add GPT-5 models to temperature-unsupported listpr_agent/algo/init.py
NO_SUPPORT_TEMPERATURE_MODELSlistgpt-5.1-codex,gpt-5.1-codex-mini,gpt-5-miniparameter