Problem
When using tool-calling agents with Moonshot AI Kimi models, multi-turn conversations fail with a 400 error on the second turn.
These models include a reasoning_content field in their responses. When tool calls are also present, the reasoning_content must be included in the assistant message sent back to the API on the next turn — otherwise the API rejects the request.
Currently this behaviour is only implemented for DeepSeek models.
Affected models:
- Moonshot AI:
kimi-k2, kimi-k2.5, and other Kimi reasoning variants — reasoning_content is required for multi-turn tool-calling; omitting it causes a 400 error.
- Zhipu AI:
GLM-5, etc. — reasoning_content is not strictly required (no error without it), but including it is beneficial for model performance.
Question
Is there a recommended way to support reasoning_content for these additional providers?
Problem
When using tool-calling agents with Moonshot AI Kimi models, multi-turn conversations fail with a
400error on the second turn.These models include a
reasoning_contentfield in their responses. When tool calls are also present, thereasoning_contentmust be included in the assistant message sent back to the API on the next turn — otherwise the API rejects the request.Currently this behaviour is only implemented for DeepSeek models.
Affected models:
kimi-k2,kimi-k2.5, and other Kimi reasoning variants —reasoning_contentis required for multi-turn tool-calling; omitting it causes a400error.GLM-5, etc. —reasoning_contentis not strictly required (no error without it), but including it is beneficial for model performance.Question
Is there a recommended way to support
reasoning_contentfor these additional providers?