Skip to content

[Bug]: kimi/kimi-code LLM tool call validation errors when parameters are missing-bug #55005

Description

@weesky2016-ui

Bug type

Regression (worked before, now fails)

Summary


name: Bug report
about: LLM tool call validation errors when parameters are missing
title: '[Bug] Tool calls fail with validation errors when required parameters are omitted'
labels: bug, tool-calling, validation
assignees: ''


Bug Description

When LLM fails to construct complete parameters during a tool call chain, it repeatedly calls the same tool (passing empty object {} or missing required parameters), resulting in repetitive validation errors. This is not an issue with individual tools, but a flaw in the tool calling mechanism's retry behavior when parameter construction fails.

Environment

Item Version/Info
OpenClaw Version Latest (2026-03-24)
Host chen's Mac mini
OS Darwin 25.2.0 (arm64)
Node.js v24.14.0
Model kimi/kimi-code
Default Model kimi/kimi-code
Shell zsh
Channel webchat

Steps to Reproduce

  1. Trigger a task requiring multi-step tool calls
  2. During parameter construction, if LLM fails to properly populate required parameters
  3. Observe the tool being called multiple times (with empty object {})
  4. Each call returns the same validation error

Actual Behavior

Error Type 1: read tool missing path parameter

Missing required parameter: path alias. Supply correct parameters before retrying.
  • Occurrences: 7 times
  • Trigger scenario: Calling read with only empty object {}, without providing file_path or path

Error Type 2: exec tool missing command parameter

Validation failed for tool "exec": command: must have required property 'command'
  • Occurrences: 10+ times
  • Trigger scenario: Calling exec with only empty object {}, without providing command

Error Type 3: feishu_drive_file tool missing action parameter

Validation failed for tool "feishu_drive_file": action: must have required property 'action'
  • Occurrences: 3 times
  • Trigger scenario: Calling feishu_drive_file with only empty object {}, without providing action

Expected Behavior

  1. Pre-validation: System should validate all required parameters are populated before sending tool calls
  2. Single failure: If parameter construction fails, should error only once instead of repeatedly calling the same tool
  3. Friendly hints: Error messages should guide LLM on how to correctly fill missing parameters
  4. Graceful degradation: If parameters cannot be constructed, should stop current tool chain instead of retrying

Root Cause Analysis

The core issues are:

  1. Fallback behavior on parameter construction failure: When LLM cannot correctly construct complex parameters, it may fallback to passing empty object {}
  2. Lack of pre-validation: System does not validate parameter completeness before sending
  3. Over-aggressive retry mechanism: After encountering validation errors, LLM attempts to call again but still uses the same empty parameters

Suggested Fix

Option 1: Client-side Pre-validation (Recommended)

Before sending tool call requests, system layer validates all required parameters exist:

  • If missing, immediately return structured error to LLM instead of sending to tool layer
  • This avoids invalid remote calls

Option 2: Error Feedback Optimization

When detecting empty parameters or missing required parameters:

  • Return more detailed errors containing parameter schema information
  • Prompt LLM which fields need to be filled

Option 3: Retry Limiting

For validation errors (e.g., missing required parameter):

  • Limit retry count to 1
  • Or require LLM to modify parameters before continuing

Additional Context

Complete Error Log Timeline

[15:16:35] read: Missing required parameter: path alias (×7)
[15:16:42] exec: Missing required property 'command' (×10+)
[15:16:48] feishu_drive_file: Missing required property 'action' (×3)

Original User Request

"Send the README.md file to my Feishu cloud drive"

This was a simple request, but triggered multiple tool call errors during execution.

Checklist

  • I have checked existing issues and found no duplicates
  • I have provided reproduction steps and environment information
  • This is not a tool-specific issue, but a tool calling mechanism issue

Steps to reproduce

  1. Trigger a task requiring multi-step tool calls
  2. During parameter construction, if LLM fails to properly populate required parameters
  3. Observe the tool being called multiple times (with empty object {})
  4. Each call returns the same validation error

Expected behavior

  1. Pre-validation: System should validate all required parameters are populated before sending tool calls
  2. Single failure: If parameter construction fails, should error only once instead of repeatedly calling the same tool
  3. Friendly hints: Error messages should guide LLM on how to correctly fill missing parameters
  4. Graceful degradation: If parameters cannot be constructed, should stop current tool chain instead of retrying

Actual behavior

Error Type 1: read tool missing path parameter

Missing required parameter: path alias. Supply correct parameters before retrying.
  • Occurrences: 7 times
  • Trigger scenario: Calling read with only empty object {}, without providing file_path or path

Error Type 2: exec tool missing command parameter

Validation failed for tool "exec": command: must have required property 'command'
  • Occurrences: 10+ times
  • Trigger scenario: Calling exec with only empty object {}, without providing command

Error Type 3: feishu_drive_file tool missing action parameter

Validation failed for tool "feishu_drive_file": action: must have required property 'action'
  • Occurrences: 3 times
  • Trigger scenario: Calling feishu_drive_file with only empty object {}, without providing action

OpenClaw version

2026-03-24

Operating system

macOS Darwin 25.2.0

Install method

npm

Model

kimi/kimi-code

Provider / routing chain

openclaw-> kimi/kimi-code

Additional provider/model setup details

Image

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

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions