openclaw - 💡(How to fix) Fix /btw command fails with max tokens error: model[MiniMax-M2.7] does not support max tokens > 196608

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…

Error Message

Error: ⚠️ /btw failed: 400 {"type":"error","error":{"type":"invalid_request_error","message":"invalid params, model[MiniMax-M2.7] does not support max tokens > 196608 (2013)"}} The /btw execution path appears to be using the wrong maxTokens value (196608 from MiniMax-M2.5) when sending a request for MiniMax-M2.7. The error message confirms the model is correctly identified as MiniMax-M2.7, but the max_tokens parameter is set to the MiniMax-M2.5 default. 3. Observe error: max_tokens > 196608 rejected

Root Cause

Investigation reveals that 196608 corresponds to the maxTokens of MiniMax-M2.5 in openclaw's provider catalog:

  • MiniMax-M2.5contextWindow: 196608, maxTokens: 196608
  • MiniMax-M2.7contextWindow: 131072, maxTokens: 131072 (as configured)

The /btw execution path appears to be using the wrong maxTokens value (196608 from MiniMax-M2.5) when sending a request for MiniMax-M2.7. The error message confirms the model is correctly identified as MiniMax-M2.7, but the max_tokens parameter is set to the MiniMax-M2.5 default.

This suggests that somewhere in the /btw execution path, model parameters are being resolved from the wrong model entry.

Code Example

⚠️ /btw failed: 400 {"type":"error","error":{"type":"invalid_request_error","message":"invalid params, model[MiniMax-M2.7] does not support max tokens > 196608 (2013)"}}
RAW_BUFFERClick to expand / collapse

Bug Description

Trigger: /btw command (e.g., /btw 你干嘛呢?)

Error:

⚠️ /btw failed: 400 {"type":"error","error":{"type":"invalid_request_error","message":"invalid params, model[MiniMax-M2.7] does not support max tokens > 196608 (2013)"}}

Observation: Normal chat works fine with the same model. Only /btw fails.

Root Cause

Investigation reveals that 196608 corresponds to the maxTokens of MiniMax-M2.5 in openclaw's provider catalog:

  • MiniMax-M2.5contextWindow: 196608, maxTokens: 196608
  • MiniMax-M2.7contextWindow: 131072, maxTokens: 131072 (as configured)

The /btw execution path appears to be using the wrong maxTokens value (196608 from MiniMax-M2.5) when sending a request for MiniMax-M2.7. The error message confirms the model is correctly identified as MiniMax-M2.7, but the max_tokens parameter is set to the MiniMax-M2.5 default.

This suggests that somewhere in the /btw execution path, model parameters are being resolved from the wrong model entry.

Environment

  • OpenClaw version: ~2026.5.22
  • Model: MiniMax-M2.7 via minimax-portal
  • Channel: Telegram (and likely webchat)

Steps to Reproduce

  1. Have an active session with MiniMax-M2.7 configured as the default model
  2. Send /btw [any short text] in the session
  3. Observe error: max_tokens > 196608 rejected

Expected Behavior

/btw should work identically to normal chat for the same model, using the correct maxTokens value (131072 for MiniMax-M2.7).

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…

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 /btw command fails with max tokens error: model[MiniMax-M2.7] does not support max tokens > 196608