-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
Git provider
Github Cloud
System Info
- GPT 5.1 / GPT 5.1 Codex
- GitHub Actions
Bug details
PR Agent always sends "minimal" to the OpenAI API, which results in a request failure because gpt-5.1-codex does not support "minimal".
Ref : https://openai.com/index/gpt-5-1-for-developers/
This makes the model completely unusable with PR Agent.
Error message
Unsupported value: 'minimal' is not supported with the 'gpt-5.1-codex' model.
Supported values are: 'low', 'medium', and 'high'.
How to reproduce
.pr_agent.toml:
[config]
model = "gpt-5.1-codex"
reasoning_effort = "high"
Run any PR Agent command that triggers an LLM call.
Root cause
The issue originates from this block in litellm_ai_handler.py:
pr-agent/pr_agent/algo/ai_handlers/litellm_ai_handler.py
Lines 294 to 305 in 5ec92b3
| if model.startswith('gpt-5'): | |
| if model.endswith('_thinking'): | |
| thinking_kwargs_gpt5 = { | |
| "reasoning_effort": 'low', | |
| "allowed_openai_params": ["reasoning_effort"], | |
| } | |
| else: | |
| thinking_kwargs_gpt5 = { | |
| "reasoning_effort": 'minimal', | |
| "allowed_openai_params": ["reasoning_effort"], | |
| } | |
| model = 'openai/'+model.replace('_thinking', '') # remove _thinking suffix |
if model.startswith('gpt-5'):
if model.endswith('_thinking'):
thinking_kwargs_gpt5 = {
"reasoning_effort": 'low',
"allowed_openai_params": ["reasoning_effort"],
}
else:
thinking_kwargs_gpt5 = {
"reasoning_effort": 'minimal',
"allowed_openai_params": ["reasoning_effort"],
}
model = 'openai/'+model.replace('_thinking', '') # remove _thinking suffix
This forces gpt-5 / gpt-5.1-codex to send:
{"reasoning_effort": "minimal"}
regardless of the user’s configuration.
Metadata
Metadata
Assignees
Labels
No labels