Skip to content

Commit 9488f88

Browse files
shrey150claude
andauthored
Fix reasoning_effort error for GPT-5.1/5.2 models in local mode (#317)
GPT-5.1 and GPT-5.2 reject reasoning_effort: "minimal" with error: "Unsupported value: 'reasoning_effort' does not support 'minimal'". Set reasoning_effort to "low" for these models to avoid the error. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8e7b1d1 commit 9488f88

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

stagehand/llm/client.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ async def create_response(
114114
if "gpt-5" in completion_model:
115115
filtered_params["temperature"] = 1
116116

117+
# GPT-5.1 and GPT-5.2 don't support "minimal" reasoning_effort.
118+
# Set "low" for these models to avoid OpenAI API errors.
119+
if "gpt-5.1" in completion_model or "gpt-5.2" in completion_model:
120+
filtered_params["reasoning_effort"] = "low"
121+
117122
self.logger.debug(
118123
f"Calling litellm.acompletion with model={completion_model} and params: {filtered_params}",
119124
category="llm",

0 commit comments

Comments
 (0)