mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-25 05:39:32 +00:00
Fix MiniMax-M3 Anthropic-compatible requests so OpenClaw no longer sends the disabled-thinking payload that makes M3 return empty content. M3 defaults now stay on MiniMax's omitted/adaptive thinking path, explicit `/think off` is still respected, and MiniMax-M2.x keeps the disabled-thinking default that prevents reasoning_content leaks. Also wires the MiniMax thinking policy through bundled provider-policy loading so pre-runtime and configless embedded-agent paths resolve the same defaults. Thanks @IamVNIE for the live MiniMax API repro and initial patch.
24 lines
778 B
TypeScript
24 lines
778 B
TypeScript
// MiniMax thinking policy keeps M3 active by default while preserving M2.x leak prevention.
|
|
import type { ProviderThinkingProfile } from "openclaw/plugin-sdk/plugin-entry";
|
|
|
|
const BUDGET_THINKING_LEVELS = ["off", "minimal", "low", "medium", "high"] as const;
|
|
const ADAPTIVE_THINKING_LEVELS = ["off", "adaptive"] as const;
|
|
|
|
export function resolveMinimaxThinkingProfile(
|
|
modelId: string,
|
|
): ProviderThinkingProfile | undefined {
|
|
if (/^MiniMax-M3(\b|[-.])/i.test(modelId)) {
|
|
return {
|
|
levels: ADAPTIVE_THINKING_LEVELS.map((id) => ({ id })),
|
|
defaultLevel: "adaptive",
|
|
};
|
|
}
|
|
if (/^MiniMax-M2(?:\b|[-.])/i.test(modelId)) {
|
|
return {
|
|
levels: BUDGET_THINKING_LEVELS.map((id) => ({ id })),
|
|
defaultLevel: "off",
|
|
};
|
|
}
|
|
return undefined;
|
|
}
|