openclaw - 💡(How to fix) Fix Tool calls emit empty arguments `{}` when content parameter is large (write/exec) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#70033Fetched 2026-04-23 07:30:08
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Timeline (top)
commented ×1mentioned ×1subscribed ×1

Error Message

  • If tool arguments are truncated or empty, Gateway should retry or surface a clear error rather than repeatedly attempting the same pattern

Fix Action

Fix / Workaround

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

Code Example

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

Received arguments: {}

---

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

Received arguments: {}
RAW_BUFFERClick to expand / collapse

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.

extent analysis

TL;DR

Implementing a retry mechanism with chunked content or using a temporary file approach may help mitigate the issue of empty tool arguments when generating large content.

Guidance

  • Investigate the model output token truncation and Bedrock streaming limitations to determine if there's a size threshold that's causing the issue.
  • Consider implementing a chunking mechanism to break down large content into smaller, manageable pieces that can be processed without truncation.
  • Use a temporary file approach with exec and heredoc to handle large content, as this has shown to be somewhat reliable in the past.
  • Review the Gateway's error handling to ensure it can surface clear errors or retry when encountering truncated or empty tool arguments.

Example

// Pseudocode example of chunking large content
const largeContent = "..."; // ~5KB markdown content
const chunkSize = 1024; // adjust based on model/output limitations
const chunks = [];
for (let i = 0; i < largeContent.length; i += chunkSize) {
  chunks.push(largeContent.slice(i, i + chunkSize));
}
// Process each chunk individually
chunks.forEach((chunk) => {
  // Use chunk with write or exec tool
});

Notes

The provided workaround of retrying or breaking content into smaller chunks is unreliable and may not always work. A more robust solution would involve addressing the underlying cause of the truncation or empty arguments.

Recommendation

Apply a workaround using chunked content or a temporary file approach, as upgrading to a fixed version is not mentioned as an option in the issue. This will help mitigate the issue until a more permanent solution can be implemented.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Tool calls emit empty arguments `{}` when content parameter is large (write/exec) [1 comments, 2 participants]