Skip to content

[Bug]: kimi-coding tool_use regression since 909f26a26 — tools converted to OpenAI function format breaks tool calling #40552

@1972811753

Description

@1972811753

Bug type

Regression (worked before, now fails)

Summary

After commit 909f26a (fix(kimi-coding): normalize anthropic tool payload format), kimi-coding/k2p5 no longer returns proper tool_use content blocks. The model outputs tool calls as plain text XML instead, with stopReason: "stop" instead of stopReason: "toolUse".

Steps to reproduce

  1. Configure kimi-coding/k2p5 as the model provider
  2. Send a message that triggers tool usage (e.g. a coding task requiring file reads)
  3. Observe model response

Expected behavior

Model returns structured tool_use content blocks with stopReason: "toolUse", as it did before v2026.3.7 (confirmed working on 2026-03-04 session logs).

Actual behavior

Model returns tool calls as plain text XML embedded in a text content block, with stopReason: "stop". The agent loop cannot parse these as real tool calls, so tools are never executed.

Root cause:
Commit 909f26a (2026-03-05, included in v2026.3.7) added compat: { requiresOpenAiAnthropicToolPayload: true } to the kimi-coding model config (src/agents/models-config.providers.static.ts:237). This triggers createAnthropicToolPayloadCompatibilityWrapper which converts tool definitions from Anthropic native format (name + input_schema) to OpenAI function format (type: "function" + function: { name, parameters }).

However, kimi-coding's anthropic-messages API endpoint expects Anthropic native tool format. Session logs from 2026-03-04 (before this commit) confirm that kimi-coding/k2p5 handled Anthropic native tool format correctly and returned proper tool_use blocks.

Suggested fix:
Remove requiresOpenAiAnthropicToolPayload: true from the kimi-coding model config, or set it to false, so tools are sent in Anthropic native format.

OpenClaw version

current main (post-v2026.3.7), regression introduced in 909f26a

Operating system

macOS 15 (Darwin 24.6.0)

Install method

pnpm dev (source)

Logs, screenshots, and evidence

Working session (2026-03-04): stopReason: "toolUse", response contains toolCall content blocks
Broken session (post 909f26a26): stopReason: "stop", response contains tool calls as XML text in text content blocks
Last known good: pre-909f26a26 (before 2026-03-05)
First known bad: 909f26a26 (2026-03-05), included in v2026.3.7

Impact and severity

Affected: All kimi-coding/k2p5 users
Severity: High (tool calling completely non-functional)
Frequency: 100% repro
Consequence: Agent cannot use any tools, making kimi-coding unusable for agentic workflows

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingregressionBehavior that previously worked and now fails

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions