Skip to content

Tool calls emit empty arguments {} when content parameter is large (write/exec) #70033

Description

@kobewang1234

Environment:

  • OpenClaw: 2026.4.15 (041266a)
  • Node: v22.22.0
  • OS: Linux 6.17.0-1010-aws (aarch64, Ubuntu 24.04)
  • Provider: Amazon Bedrock
  • Model: global.anthropic.claude-opus-4-6-v1

Bug Description:
When generating tool calls with large content (e.g., writing a ~5KB markdown file via write or exec), the model emits tool calls with empty arguments {}, causing validation failures:

Validation failed for tool "write":
  - path: must have required property 'path'
  - content: must have required property 'content'

Received arguments: {}

and

Validation failed for tool "exec":
  - command: must have required property 'command'

Received arguments: {}

Reproduction:

  1. Ask the assistant to create a comprehensive markdown analysis file (~5-7KB content)
  2. The write tool call is emitted with empty {} arguments
  3. Falling back to exec (e.g., cat << EOF > file) also produces empty {} arguments
  4. The pattern repeats consistently across multiple retries and sessions

Scale of Impact:
In our case, this bug triggered 35+ consecutive failures across multiple sessions (write ~4 failures, exec ~30+ failures) before eventually succeeding. The same task with shorter content works fine.

Possible Causes:

  1. Model output token truncation causing incomplete JSON serialization of tool arguments
  2. Bedrock streaming may be dropping the tool_use content block when it exceeds a size threshold
  3. Gateway may not be handling partial/malformed tool_use blocks gracefully

Expected Behavior:

  • If tool arguments are truncated or empty, Gateway should retry or surface a clear error rather than repeatedly attempting the same pattern
  • Ideally, large content should be chunked or handled via a temp file approach automatically

Workaround:
Eventually succeeded by retrying enough times. Breaking the content into smaller chunks or using exec with heredoc sometimes works, but is unreliable.

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