fix(openrouter): remove conflicting reasoning_effort from payload#24120
Merged
gumadeiras merged 2 commits intoopenclaw:mainfrom Feb 23, 2026
Merged
Conversation
a2c0cf3 to
29fb038
Compare
29fb038 to
cc8ef4b
Compare
Member
ethvilet
pushed a commit
to ethvilet/openclaw
that referenced
this pull request
Feb 23, 2026
…enclaw#24120) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: cc8ef4b Co-authored-by: tenequm <22403766+tenequm@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
3 tasks
jaydiamond42
pushed a commit
to jaydiamond42/bloomtbot
that referenced
this pull request
Feb 23, 2026
…enclaw#24120) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: cc8ef4b Co-authored-by: tenequm <22403766+tenequm@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
carlosrivera
pushed a commit
to myascendai/meshiclaw
that referenced
this pull request
Feb 23, 2026
…enclaw#24120) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: cc8ef4b Co-authored-by: tenequm <22403766+tenequm@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
gabrielkoo
pushed a commit
to gabrielkoo/openclaw
that referenced
this pull request
Feb 23, 2026
…enclaw#24120) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: cc8ef4b Co-authored-by: tenequm <22403766+tenequm@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
mreedr
pushed a commit
to mreedr/openclaw-custom
that referenced
this pull request
Feb 24, 2026
…enclaw#24120) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: cc8ef4b Co-authored-by: tenequm <22403766+tenequm@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
margulans
pushed a commit
to margulans/Neiron-AI-assistant
that referenced
this pull request
Feb 25, 2026
…enclaw#24120) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: cc8ef4b Co-authored-by: tenequm <22403766+tenequm@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
brianleach
pushed a commit
to brianleach/openclaw
that referenced
this pull request
Feb 26, 2026
…enclaw#24120) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: cc8ef4b Co-authored-by: tenequm <22403766+tenequm@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
mylukin
pushed a commit
to mylukin/openclaw
that referenced
this pull request
Feb 26, 2026
…enclaw#24120) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: cc8ef4b Co-authored-by: tenequm <22403766+tenequm@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
r4jiv007
pushed a commit
to r4jiv007/openclaw
that referenced
this pull request
Feb 28, 2026
…enclaw#24120) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: cc8ef4b Co-authored-by: tenequm <22403766+tenequm@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
zooqueen
pushed a commit
to hanzoai/bot
that referenced
this pull request
Mar 6, 2026
…enclaw#24120) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: cc8ef4b Co-authored-by: tenequm <22403766+tenequm@users.noreply.github.com> Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com> Reviewed-by: @gumadeiras
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
reasoning_effortfield from OpenRouter payloads before injecting the nestedreasoning: { effort }format, preventing a400 Only one of "reasoning" and "reasoning_effort" may be providederrorFixes #24119
Problem
When using reasoning models via OpenRouter (e.g. MiniMax M2.5), two code paths independently inject reasoning parameters:
buildParams()setsparams.reasoning_effort(OpenAI flat format) when a model hasreasoning: truecreateOpenRouterWrapper()injectspayload.reasoning = { effort }(OpenRouter nested format) viaonPayloadBoth fields end up in the final payload, which OpenRouter rejects.
This was introduced by the interaction between PR #17236 (added
reasoning.effortinjection) and PR #22513 (defaulted reasoning toonforreasoning: truemodels).Solution
Delete the conflicting top-level
reasoning_effortfield in theonPayloadhook before injecting the correct nested format. This is a singledeletecall, scoped to the OpenRouter wrapper only.Test plan
🤖 Generated with Claude Code
Greptile Summary
Single-line fix in the OpenRouter
onPayloadhook that removes the top-levelreasoning_effortfield (set by pi-ai'sbuildParams()) before injecting the nestedreasoning: { effort }format that OpenRouter expects. This prevents a400 Only one of "reasoning" and "reasoning_effort" may be providederror for reasoning models (e.g. MiniMax M2.5) routed through OpenRouter.deleteis correctly scoped: only runs insidecreateOpenRouterWrapperand only whenthinkingLevelis truthy (i.e., when the nested format will be injected)Confidence Score: 5/5
deletecall scoped entirely within the OpenRouter-only wrapper function. It only executes whenthinkingLevelis set (the same condition under which the nested format is injected), anddeleteon a non-existent property is a safe no-op. Non-OpenRouter providers are completely unaffected. The comment clearly explains the rationale.Last reviewed commit: a2c0cf3
(4/5) You can add custom instructions or style guidelines for the agent here!