Skip to content

Conversation

@dzmitryashkinadze
Copy link

@dzmitryashkinadze dzmitryashkinadze commented Nov 24, 2025

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

flowchart LR
  A["GPT-5 Models<br/>gpt-5.1-codex<br/>gpt-5.1-codex-mini<br/>gpt-5-mini"] -- "Added to" --> B["NO_SUPPORT_TEMPERATURE_MODELS"]
  B -- "Prevents" --> C["Temperature Parameter<br/>Errors"]
Loading

File Walkthrough

Relevant files
Bug fix
__init__.py
Add GPT-5 models to temperature-unsupported list                 

pr_agent/algo/init.py

  • Added three GPT-5 series models to NO_SUPPORT_TEMPERATURE_MODELS list
  • Models added: gpt-5.1-codex, gpt-5.1-codex-mini, gpt-5-mini
  • Resolves BadRequestError when improve tool attempts to set temperature
    parameter
+3/-0     

@qodo-merge-for-open-source
Copy link
Contributor

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🟡
🎫 #1985
🔴 Update max token configuration for model gpt-5-mini
Fix the error "Ensure gpt-5-mini is defined in MAX_TOKENS in ./pr_agent/algo/__init__.py
or set a positive value for it in config.custom_model_max_tokens"
Resolve the failure to generate code suggestions for PR with gpt-5-mini model
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Consistent Naming Conventions

Objective: All new variables, functions, and classes must follow the project's established naming
standards

Status: Passed

No Dead or Commented-Out Code

Objective: Keep the codebase clean by ensuring all submitted code is active and necessary

Status: Passed

Robust Error Handling

Objective: Ensure potential errors and edge cases are anticipated and handled gracefully throughout
the code

Status: Passed

Single Responsibility for Functions

Objective: Each function should have a single, well-defined responsibility

Status: Passed

When relevant, utilize early return

Objective: In a code snippet containing multiple logic conditions (such as 'if-else'), prefer an
early return on edge cases than deep nesting

Status: Passed

Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-merge-for-open-source
Copy link
Contributor

PR Code Suggestions ✨

No code suggestions found for the PR.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant