-
-
Notifications
You must be signed in to change notification settings - Fork 69.5k
Intermittent "23 validation errors: Field required" on tool calls with missing function field #35667
Description
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:
- Start an agent session with tool access
- Execute multiple tool calls in rapid succession (e.g., read → edit → exec)
- 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
functionfield 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:
- Different from openai-codex provider: pipe-delimited tool call IDs written to transcript break Codex API validation #35528 (pipe-delimited tool call IDs)
- Different from Fix: prevent Invalid diff now finding less tool calls error #35379 (streaming tool call count regression)
- This appears to be a NEW schema validation issue
Labels: agents, gateway, bug, validation