Skip to content

[Bug]: anthropic-messages provider sends tool definitions in wrong format after v2026.3.2 upgrade — Kimi Coding API rejects with "23 validation errors" #37038

@mochimochimochi-hub

Description

@mochimochimochi-hub

Bug type

Regression (worked before, now fails)

Summary

After upgrading from v2026.3.1 to v2026.3.2, cron jobs that use tools (exec, read, write, etc.) fail with 23 validation errors when using the kimi-coding provider (api: "anthropic-messages"). The API rejects tool definitions because 'function' field is missing — indicating OpenClaw is now sending Anthropic-format tool definitions instead of OpenAI-format, but the Kimi /coding/ endpoint expects OpenAI-format tool schemas even though it uses Anthropic message format for conversations.

Regular chat (no tools) works fine on both versions.

Steps to reproduce

  1. Configure kimi-coding provider with api: "anthropic-messages":
{
  "kimi-coding": {
    "baseUrl": "https://api.kimi.com/coding/",
    "api": "anthropic-messages",
    "models": [
      {
        "id": "k2p5",
        "name": "Kimi for Coding",
        "reasoning": true,
        "input": ["text", "image"],
        "api": "anthropic-messages",
        "contextWindow": 262144,
        "maxTokens": 32768
      }
    ]
  }
}
  1. Set as default model: "primary": "kimi-coding/k2p5"
  2. Run any task that requires tools (e.g., a cron job that uses exec, read, write)

Expected behavior

Tool-bearing requests should succeed, as they did on v2026.3.1.

Actual behavior

API returns:

[Error: request could not be processed] {"error":{"message":"23 validation errors:\n
{'type': 'missing', 'loc': ('body', 'tools', 0, 'function'), 'msg': 'Field required',
'input': {'name': 'read', 'description': 'Read the contents of a file. Supports text files
and images (jpg, png, gif, webp). Images are sent as attachments. For text files, output is
truncated to 2000 lines or 50KB (whichever is hit first). Use offset/limit for large files.
When you need the full file, continue with offset until complete.', 'input_schema': {'type': ...

All 23 errors follow the same pattern: 'loc': ('body', 'tools', N, 'function'), 'msg': 'Field required' — the API expects each tool to be wrapped in a function object (OpenAI format), but OpenClaw is sending them without it (Anthropic format).

OpenClaw version

  • OpenClaw version (broken): 2026.3.2 - OpenClaw version (working): 2026.3.1

Operating system

OS: Raspberry Pi OS (Debian, arm64)

Install method

No response

Logs, screenshots, and evidence

Impact and severity

No response

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