openclaw - ✅(Solved) Fix [Bug]: OpenRouter. 400 Reasoning is mandatory for this endpoint and cannot be disabled. [1 pull requests, 1 comments, 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#58880Fetched 2026-04-08 02:31:35
View on GitHub
Comments
1
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×2cross-referenced ×1referenced ×1

After upgrading from 2026.3.24 to 2026.3.28/2026.3.31, for any OpenRouter free model got message: "400 Reasoning is mandatory for this endpoint and cannot be disabled."

Tested with: "openrouter/stepfun/step-3.5-flash:free", "openrouter/qwen/qwen3-next-80b-a3b-instruct:free", "openrouter/minimax/minimax-m2.5:free", "openrouter/auto",

Rollback to 2026.3.24 help go back to work again. "openrouter/stepfun/step-3.5-flash:free" - works like a charm.

ability /think /reasoning for session not helps.

Root Cause

  1. Start OpenClaw 2026.3.23.
  2. Setup any openrouter free model.
  3. Check if it work.
  4. Update OpenClaw to latest.
  5. Improve settings, because some things are broken, like tts providers.
  6. Check work with model.

Fix Action

Fixed

PR fix notes

PR #58980: fix: strip reasoning object when thinking is off to prevent 400 on mandatory-reasoning endpoints (#58880)

Description (problem / solution / changelog)

Summary

Fixes #58880.

When thinkingLevel is "off" (or undefined), normalizeProxyReasoningPayload correctly deletes reasoning_effort but returns without deleting the reasoning object. The upstream @mariozechner/pi-ai library may inject reasoning: { effort: "none" } into the payload. This survives to the API request and causes OpenRouter to return 400 "Reasoning is mandatory for this endpoint and cannot be disabled" for models like anthropic/claude-sonnet-4 where reasoning cannot be turned off.

Changes

  • src/agents/pi-embedded-runner/proxy-stream-wrappers.ts: Add delete payloadObj.reasoning before the early return in normalizeProxyReasoningPayload when thinking is off/undefined.
  • src/agents/pi-embedded-runner/proxy-stream-wrappers.test.ts: Add regression tests verifying both reasoning and reasoning_effort are stripped for OpenRouter and Kilocode wrappers when thinking is off, undefined, and preserved when thinking is active.

Test plan

  • pnpm test -- src/agents/pi-embedded-runner/proxy-stream-wrappers.test.ts — 5 tests pass
  • pnpm check — clean

Changed files

  • src/agents/pi-embedded-runner/proxy-stream-wrappers.test.ts (modified, +87/-1)
  • src/agents/pi-embedded-runner/proxy-stream-wrappers.ts (modified, +5/-0)
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

After upgrading from 2026.3.24 to 2026.3.28/2026.3.31, for any OpenRouter free model got message: "400 Reasoning is mandatory for this endpoint and cannot be disabled."

Tested with: "openrouter/stepfun/step-3.5-flash:free", "openrouter/qwen/qwen3-next-80b-a3b-instruct:free", "openrouter/minimax/minimax-m2.5:free", "openrouter/auto",

Rollback to 2026.3.24 help go back to work again. "openrouter/stepfun/step-3.5-flash:free" - works like a charm.

ability /think /reasoning for session not helps.

Steps to reproduce

  1. Start OpenClaw 2026.3.23.
  2. Setup any openrouter free model.
  3. Check if it work.
  4. Update OpenClaw to latest.
  5. Improve settings, because some things are broken, like tts providers.
  6. Check work with model.

Expected behavior

Expected normal work with openrouter/xxxxx:free models, or possibility to setup thinking/reasoning in settings.

Actual behavior

for any OpenRouter/:free model got message: "400 Reasoning is mandatory for this endpoint and cannot be disabled."

OpenClaw version

2026.3.31

Operating system

Windows 10

Install method

npm install

Model

openrouter/stepfun/step-3.5-flash:free, any "openrouter/model_name_whatever:free",

Provider / routing chain

openclaw -> gateway ->openrouter/any_model:free

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

TL;DR

The issue can likely be resolved by re-enabling or configuring the reasoning setting for the OpenRouter free models in the latest OpenClaw version.

Guidance

  • The error message "400 Reasoning is mandatory for this endpoint and cannot be disabled" suggests that the reasoning setting is now required for OpenRouter free models, which was not the case in version 2026.3.24.
  • To mitigate the issue, try to find the reasoning setting in the OpenClaw configuration and enable it for the affected models.
  • If the setting is not available, check the OpenClaw documentation or release notes for version 2026.3.28 or 2026.3.31 to see if there are any new requirements or configuration options for OpenRouter free models.
  • Consider reaching out to the OpenClaw support team or community for further assistance, as the issue may be related to a specific change in the latest version.

Notes

The issue seems to be specific to the latest OpenClaw versions (2026.3.28 and 2026.3.31) and may be related to a change in the requirements for OpenRouter free models. Without more information about the configuration options or release notes, it is difficult to provide a more specific solution.

Recommendation

Apply workaround: The best course of action is to try to enable or configure the reasoning setting for the affected models, as this seems to be the most likely solution based on the error message. If this is not possible, reaching out to the OpenClaw support team or community may be necessary to resolve the issue.

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

Expected normal work with openrouter/xxxxx:free models, or possibility to setup thinking/reasoning in settings.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING