Skip to content

Intermittent "23 validation errors: Field required" on tool calls with missing function field #35667

@voidstar-x

Description

@voidstar-x

Title: Intermittent "23 validation errors: Field required" on tool calls with missing function field

Description:
Tool calls intermittently fail with a Zod validation error indicating a missing required function field, even when the tool call appears to be properly formatted. This occurs sporadically during normal agent operations.

Error Message:

23 validation errors:
  {'type': 'missing', 'loc': ('body', 'tools', 0, 'function'), 'msg': 'Field required', 'input': {'name': 'read', 'description': 'Read the contents of a file...', 'input_schema': {'type': 'object', ...}}}

Frequency:

  • ~20-30% of tool calls under load
  • Higher frequency with rapid successive tool calls
  • Occurs with multiple tool types (read, edit, exec)

Environment:

  • OpenClaw Version: 2026.2.21-2
  • Model: kimi-coding/k2p5
  • OS: Linux 6.6.87.2-microsoft-standard-WSL2
  • Node: v22.22.0
  • Shell: bash

Steps to Reproduce:

  1. Start an agent session with tool access
  2. Execute multiple tool calls in rapid succession (e.g., read → edit → exec)
  3. Observe intermittent validation failures

Expected Behavior:
Tool calls should consistently validate and execute without schema errors.

Actual Behavior:
Intermittent validation failures with "Field required" error for the function field, despite the tool appearing to be properly structured.

Workaround:
Retrying the failed tool call usually succeeds on the second attempt.

Additional Context:

  • Error appears to be a Zod schema validation failure
  • Missing function field suggests the tool call structure is being malformed somewhere in the pipeline
  • Not related to tool-specific logic (occurs across different tool types)
  • May be a race condition or serialization issue in the gateway/agent communication layer

Related Issues:

Labels: agents, gateway, bug, validation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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