Skip to content

Kimi K2.5 (OpenAI-compatible) tool calls fail after 2026.2.12 update — read missing path, edit missing newText #15809

Description

@kevin-computa

Summary

After updating from OpenClaw 2026.2.9 to 2026.2.12, the embedded agent using Kimi K2.5 via Moonshot Direct (OpenAI-compatible API at api.moonshot.ai) consistently generates malformed tool calls. This worked correctly on 2026.2.9.

Symptoms

  1. read tool called without path — The model sends an object but omits the path (and file_path) parameter entirely. Happens systematically (18+ occurrences in a single day):

    [agent/embedded] read tool called without path: toolCallId=read:40 argsType=object
    
  2. edit tool missing newText/new_string — The model calls edit without providing either accepted parameter name:

    [tools] edit failed: Missing required parameter: newText (newText or new_string)
    
  3. edit exact match failures — Downstream effect when the model eventually sends valid params but wrong content:

    [tools] edit failed: Could not find the exact text in /Users/.../.openclaw/openclaw.json
    

Environment

  • OpenClaw version: 2026.2.12 (worked on 2026.2.9)
  • Model: moonshot/kimi-k2.5 via Moonshot Direct (api.moonshot.ai, OpenAI-compatible API)
  • OS: macOS (darwin 25.1.0)
  • Node: 22.22.0

Analysis

The tool schemas come from @mariozechner/pi-coding-agent and are wrapped by patchToolSchemaForClaudeCompatibility() which adds aliases (file_pathpath, old_stringoldText, new_stringnewText). Despite these aliases, Kimi K2.5 appears to be sending parameters under names that none of the aliases cover.

The patchToolSchemaForClaudeCompatibility function name suggests these schemas are optimized for Claude. Non-Claude models using the OpenAI-compatible API may interpret the patched schemas differently, especially after the 2026.2.12 schema changes.

Reproduction

  1. Configure OpenClaw 2026.2.12 with moonshot/kimi-k2.5 as primary model
  2. Send any message that triggers file reads or edits
  3. Observe read tool called without path and edit failed: Missing required parameter in logs

Expected Behavior

Tool calls should work with OpenAI-compatible providers (Kimi K2.5 via Moonshot) as they did in 2026.2.9.

Suggested Fix

Consider one of:

  • Adding broader parameter name aliasing for OpenAI-compatible models (e.g., also check filename, file, filepath for read; replacement, text, content for edit)
  • Providing a config option to use simplified/legacy tool schemas for non-Claude providers
  • Testing tool schema changes against OpenAI-compatible models before release

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleMarked as stale due to inactivity

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions