openclaw - 💡(How to fix) Fix Agent command sends reasoning_effort: "none" to reasoning-only models (gpt-5.1-codex-mini) ignoring --thinking flag and thinkingDefault config [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#63340Fetched 2026-04-09 07:55:10
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Author
Participants
Timeline (top)
subscribed ×1

Error Message

  1. Observe 400 error
  2. Detects the error: unsupported thinking level for openai/gpt-5.1-codex-mini; retrying with low
  3. Surfaces error after exhausting retries

Fix Action

Workaround

Use gpt-4o (which accepts none) as primary model until this is fixed.

Code Example

400 Unsupported value: 'none' is not supported with the 'gpt-5.1-codex-mini' model. Supported values are: 'low', 'medium', and 'high'.
RAW_BUFFERClick to expand / collapse

Problem

When using gpt-5.1-codex-mini as the primary agent model, the openclaw agent command always sends reasoning_effort: "none" to the OpenAI API on the initial bootstrap/system turn, regardless of:

  • --thinking medium CLI flag
  • agents.defaults.thinkingDefault: "medium" in config
  • reasoning: true on the model definition

gpt-5.1-codex-mini rejects none with:

400 Unsupported value: 'none' is not supported with the 'gpt-5.1-codex-mini' model. Supported values are: 'low', 'medium', and 'high'.

Reproduction

  1. Configure openai/gpt-5.1-codex-mini as primary model with reasoning: true
  2. Set agents.defaults.thinkingDefault: "medium"
  3. Run: openclaw agent --session-id test --thinking medium --message "hello"
  4. Observe 400 error

Observed behavior from gateway logs

The embedded runner:

  1. Sends initial request with reasoning_effort: "none" → 400
  2. Detects the error: unsupported thinking level for openai/gpt-5.1-codex-mini; retrying with low
  3. Retry also sends none → 400
  4. Retries with high → still 400
  5. Surfaces error after exhausting retries

The retry logic changes the thinking level label but the actual API payload still contains reasoning_effort: "none" on every attempt.

Expected behavior

For reasoning-only models that don't accept none, the resolved thinking level from config/CLI should be used on the first attempt. If the model has reasoning: true and no explicit level is set, it should default to low (matching the documented fallback) rather than none.

Environment

  • OpenClaw: 2026.4.5 (3e72c03)
  • Node: v22.22.0
  • OS: Ubuntu 24.04
  • Model: openai/gpt-5.1-codex-mini
  • Provider: OpenAI API direct

Workaround

Use gpt-4o (which accepts none) as primary model until this is fixed.

extent analysis

TL;DR

Use a model that accepts reasoning_effort: "none" or modify the code to send the resolved thinking level from config/CLI on the initial request.

Guidance

  • Verify that the reasoning_effort parameter is being set correctly based on the --thinking CLI flag and agents.defaults.thinkingDefault config value.
  • Check the retry logic to ensure it updates the reasoning_effort parameter in the API payload, rather than just changing the thinking level label.
  • Consider modifying the code to default to low when reasoning: true and no explicit level is set, to match the documented fallback behavior.
  • Test with a different model, such as gpt-4o, to confirm that the issue is specific to gpt-5.1-codex-mini.

Example

No code snippet is provided as the issue does not include sufficient code context.

Notes

The issue appears to be specific to the gpt-5.1-codex-mini model and the openclaw agent command. The workaround using gpt-4o as the primary model may not be suitable for all use cases.

Recommendation

Apply workaround: Use gpt-4o as the primary model until the issue is fixed, as it accepts reasoning_effort: "none" and can provide a temporary solution.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

For reasoning-only models that don't accept none, the resolved thinking level from config/CLI should be used on the first attempt. If the model has reasoning: true and no explicit level is set, it should default to low (matching the documented fallback) rather than none.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Agent command sends reasoning_effort: "none" to reasoning-only models (gpt-5.1-codex-mini) ignoring --thinking flag and thinkingDefault config [1 participants]