openclaw/src
zerone0x bc52d4a459 fix(openrouter): skip reasoning effort injection for 'auto' routing model
The 'auto' model on OpenRouter dynamically routes to any underlying model
OpenRouter selects, including reasoning-required endpoints. Previously,
OpenClaw would unconditionally inject `reasoning.effort: "none"` into
every request when the thinking level was "off", which causes a 400 error
on models where reasoning is mandatory and cannot be disabled.

Root cause:
- openrouter/auto has reasoning: false in the built-in catalog
- With thinking level "off", createOpenRouterWrapper injects
  `reasoning: { effort: "none" }` via mapThinkingLevelToOpenRouterReasoningEffort
- For any OpenRouter-routed model that requires reasoning this results in:
  "400 Reasoning is mandatory for this endpoint and cannot be disabled"
- The reasoning: false is then persisted back to models.json on every
  ensureOpenClawModelsJson call, so manually removing it has no lasting effect

Fix:
- In applyExtraParamsToAgent, when provider is "openrouter" and the model
  id is "auto", pass undefined as thinkingLevel to createOpenRouterWrapper
  so no reasoning.effort is injected at all, letting OpenRouter's upstream
  model handle it natively
- Add an explanatory comment in buildOpenrouterProvider clarifying that the
  reasoning: false catalog value does NOT cause effort injection for "auto"

Users who need explicit reasoning control should target a specific model
id (e.g. openrouter/deepseek/deepseek-r1) rather than the auto router.

Fixes #24851

(cherry picked from commit aa55439798)
2026-02-24 04:33:51 +00:00
..
acp fix(acp): harden permission tool-name validation 2026-02-24 01:11:34 +00:00
agents fix(openrouter): skip reasoning effort injection for 'auto' routing model 2026-02-24 04:33:51 +00:00
auto-reply fix(auto-reply): expand standalone stop phrases 2026-02-24 04:02:43 +00:00
browser refactor(browser): share relay token + options validation tests 2026-02-24 04:23:22 +00:00
canvas-host
channels fix: harden legacy plugin schema compatibility tests (#24933) (thanks @pandego) 2026-02-24 03:50:53 +00:00
cli fix(cli): load plugin registry for configure and onboard commands (#17266) 2026-02-24 04:33:50 +00:00
commands chore(status): clarify bootstrap file semantics 2026-02-24 04:17:56 +00:00
compat
config fix(config): add actionable guidance for dmPolicy open allowFrom mismatch 2026-02-24 04:33:50 +00:00
cron fix(cron): treat embedded error payloads as run failures 2026-02-24 04:33:50 +00:00
daemon fix: back up existing systemd unit before overwriting on update (#24350) (#24937) 2026-02-24 03:22:55 +00:00
discord test(discord): stabilize parent-info + doctor migration assertions (#25028) 2026-02-24 04:10:52 +00:00
docs
gateway Deny cron tool on /tools/invoke by default 2026-02-24 04:33:50 +00:00
hooks fix(agents): include SOUL.md, IDENTITY.md, USER.md in subagent/cron bootstrap allowlist 2026-02-24 04:04:35 +00:00
imessage fix(security): harden account-key handling against prototype pollution 2026-02-24 01:09:31 +00:00
infra fix(hooks): decouple message:sent internal hook from mirror param 2026-02-24 04:20:30 +00:00
line fix(security): harden account-key handling against prototype pollution 2026-02-24 01:09:31 +00:00
link-understanding
logging fix(security): harden regex compilation for filters and redaction 2026-02-23 23:54:50 +00:00
markdown
media fix(security): harden session export image data-url handling 2026-02-24 02:53:39 +00:00
media-understanding refactor: de-duplicate channel runtime and payload helpers 2026-02-23 21:25:28 +00:00
memory refactor: deduplicate shared helpers and test setup 2026-02-23 20:40:44 +00:00
node-host fix(security): trust resolved skill-bin paths in allowlist auto-allow 2026-02-24 03:12:43 +00:00
pairing refactor: de-duplicate channel runtime and payload helpers 2026-02-23 21:25:28 +00:00
plugin-sdk refactor(security): unify dangerous name matching handling 2026-02-24 01:33:08 +00:00
plugins fix(plugins): pass session context to before_compaction hook in subscribe handler 2026-02-24 04:33:50 +00:00
process test: speed up supervisor test timing 2026-02-23 20:15:56 +00:00
providers Config: expand Kilo catalog and persist selected Kilo models (#24921) 2026-02-23 21:17:37 -05:00
routing fix: normalize input peer.kind in resolveAgentRoute (#22730) 2026-02-24 04:33:50 +00:00
scripts
security Deny cron tool on /tools/invoke by default 2026-02-24 04:33:50 +00:00
sessions Agents/Replies: scope done fallback to direct sessions 2026-02-22 13:30:30 -08:00
shared fix: scope Telegram RFC2544 SSRF exception to policy opt-in (#24982) (thanks @stakeswky) 2026-02-24 03:28:00 +00:00
signal fix(security): harden account-key handling against prototype pollution 2026-02-24 01:09:31 +00:00
slack refactor(security): unify dangerous name matching handling 2026-02-24 01:33:08 +00:00
telegram fix: adapt landed fixups to current type and approval constraints 2026-02-24 04:20:30 +00:00
terminal
test-helpers refactor: dedupe media and request-body test scaffolding 2026-02-22 18:37:25 +00:00
test-utils test: dedupe fixtures and test harness setup 2026-02-23 05:45:54 +00:00
tts
tui test: dedupe fixtures and test harness setup 2026-02-23 05:45:54 +00:00
types
utils refactor!: remove google-antigravity provider support 2026-02-23 05:20:14 +01:00
web fix(whatsapp): groupAllowFrom sender filter bypassed when groupPolicy is allowlist (#24670) 2026-02-24 04:20:30 +00:00
whatsapp WhatsApp: enforce allowFrom for explicit outbound sends (#20921) 2026-02-22 18:13:23 -05:00
wizard test: dedupe gateway browser discord and channel coverage 2026-02-22 17:11:54 +00:00
channel-web.ts
docker-image-digests.test.ts
docker-setup.test.ts Docker: precreate identity dir in docker setup 2026-02-22 16:33:53 -08:00
dockerfile.test.ts
entry.ts
extensionAPI.ts
globals.ts
index.ts
logger.test.ts
logger.ts
logging.ts
polls.test.ts
polls.ts
runtime.ts
utils.test.ts fix(utils): guard resolveUserPath for missing workspace input 2026-02-22 13:19:25 +01:00
utils.ts fix(utils): guard resolveUserPath for missing workspace input 2026-02-22 13:19:25 +01:00
version.test.ts test(core): increase coverage for sessions, auth choice, and model listing 2026-02-22 14:08:51 +00:00
version.ts