fix(moonshot): apply native thinking payload compatibility

This commit is contained in:
Peter Steinberger
2026-03-03 01:03:24 +00:00
parent 287606e445
commit ced267c5cb
3 changed files with 232 additions and 0 deletions

View File

@@ -146,3 +146,35 @@ Note: Moonshot and Kimi Coding are separate providers. Keys are not interchangea
- If Moonshot publishes different context limits for a model, adjust
`contextWindow` accordingly.
- Use `https://api.moonshot.ai/v1` for the international endpoint, and `https://api.moonshot.cn/v1` for the China endpoint.
## Native thinking mode (Moonshot)
Moonshot Kimi supports binary native thinking:
- `thinking: { type: "enabled" }`
- `thinking: { type: "disabled" }`
Configure it per model via `agents.defaults.models.<provider/model>.params`:
```json5
{
agents: {
defaults: {
models: {
"moonshot/kimi-k2.5": {
params: {
thinking: { type: "disabled" },
},
},
},
},
},
}
```
OpenClaw also maps runtime `/think` levels for Moonshot:
- `/think off` -> `thinking.type=disabled`
- any non-off thinking level -> `thinking.type=enabled`
When Moonshot thinking is enabled, `tool_choice` must be `auto` or `none`. OpenClaw normalizes incompatible `tool_choice` values to `auto` for compatibility.