When using Kimi models (e.g., kimi-k2.5) proxied through amazeeai, OpenClaw often crashes, returns errors, or bugs out when tool calling.
I suspect this happens because Moonshot/Kimi models have strict API constraints: they cannot handle rigid tool_choice requirements alongside thinking. OpenClaw normally intercepts and fixes these payload conflicts for native Moonshot and Ollama Cloud endpoints. However, because amazeeai is an unknown provider acting as an OpenAI-compatible proxy, OpenClaw bypasses these safety wrappers.
To Reproduce
- Configure an OpenClaw instance using the amazeeai provider.
- Use
amazeeai/kimi-k2.5 as the default model
- Attempt a task that requires tool usage.
- The bot will either not respond, or be almost entirely unhelpful.
Expected behavior
The amazeeai provider should be recognized as serving Kimi models, and the Moonshot stream wrapper should be applied to normalize the payload (e.g., downgrading tool_choice: "required" to "auto" when thinking is enabled).
Technical Details & Proposed Fix
OpenClaw's shouldApplyMoonshotPayloadCompat function in src/agents/pi-embedded-runner/moonshot-stream-wrappers.ts currently only checks for moonshot and ollama providers.
To fix this for the hosting platform, OpenClaw needs to be patched to recognize Kimi models coming from amazeeai.
Suggested fix in OpenClaw (src/agents/pi-embedded-runner/moonshot-stream-wrappers.ts)
export function shouldApplyMoonshotPayloadCompat(params: {
provider: string;
modelId: string;
}): boolean {
const normalizedProvider = params.provider.trim().toLowerCase();
const normalizedModelId = params.modelId.trim().toLowerCase();
if (normalizedProvider === "moonshot") {
return true;
}
// AmazeeAI acts as a proxy provider and proxies Kimi models like `kimi-k2.5`.
// These models share the same payload restrictions as native Moonshot endpoints.
if (normalizedProvider === "amazeeai" && normalizedModelId.startsWith("kimi-")) {
return true;
}
// ... existing ollama checks
}
Since this is an issue with how OpenClaw interacts with the amazeeai proxy, this fix likely needs to be pushed upstream to OpenClaw or patched in the hosting environment's build.
I am testing the theory locally and will submit a PR to openclaw if confirmed
When using Kimi models (e.g., kimi-k2.5) proxied through amazeeai, OpenClaw often crashes, returns errors, or bugs out when tool calling.
I suspect this happens because Moonshot/Kimi models have strict API constraints: they cannot handle rigid tool_choice requirements alongside thinking. OpenClaw normally intercepts and fixes these payload conflicts for native Moonshot and Ollama Cloud endpoints. However, because amazeeai is an unknown provider acting as an OpenAI-compatible proxy, OpenClaw bypasses these safety wrappers.
To Reproduce
amazeeai/kimi-k2.5as the default modelExpected behavior
The amazeeai provider should be recognized as serving Kimi models, and the Moonshot stream wrapper should be applied to normalize the payload (e.g., downgrading tool_choice: "required" to "auto" when thinking is enabled).
Technical Details & Proposed Fix
OpenClaw's
shouldApplyMoonshotPayloadCompatfunction in src/agents/pi-embedded-runner/moonshot-stream-wrappers.ts currently only checks for moonshot and ollama providers.To fix this for the hosting platform, OpenClaw needs to be patched to recognize Kimi models coming from amazeeai.
Suggested fix in OpenClaw (src/agents/pi-embedded-runner/moonshot-stream-wrappers.ts)
Since this is an issue with how OpenClaw interacts with the amazeeai proxy, this fix likely needs to be pushed upstream to OpenClaw or patched in the hosting environment's build.
I am testing the theory locally and will submit a PR to openclaw if confirmed