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:
- Ask the assistant to create a comprehensive markdown analysis file (~5-7KB content)
- The
write tool call is emitted with empty {} arguments
- Falling back to
exec (e.g., cat << EOF > file) also produces empty {} arguments
- 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:
- Model output token truncation causing incomplete JSON serialization of tool arguments
- Bedrock streaming may be dropping the tool_use content block when it exceeds a size threshold
- 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.
Environment:
Bug Description:
When generating tool calls with large content (e.g., writing a ~5KB markdown file via
writeorexec), the model emits tool calls with empty arguments{}, causing validation failures:and
Reproduction:
writetool call is emitted with empty{}argumentsexec(e.g.,cat << EOF > file) also produces empty{}argumentsScale 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:
Expected Behavior:
Workaround:
Eventually succeeded by retrying enough times. Breaking the content into smaller chunks or using
execwith heredoc sometimes works, but is unreliable.