Skip to content

reasoning_content support for models other than DeepSeek (GLM, Kimi, etc.) #2669

@hvppycoding

Description

@hvppycoding

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions