-
-
Notifications
You must be signed in to change notification settings - Fork 57.6k
Description
Summary
When a tool call is interrupted or fails in a specific way, OpenClaw saves a malformed tool_use block to the session history (missing the required input field). This corrupts the session permanently — all subsequent requests fail with a validation error from Claude's API, resulting in blank responses.
Steps to reproduce
- Use OpenClaw with a Claude model via the Antigravity provider
- Trigger multiple tool calls (e.g., browser automation, exec commands)
- During a tool call, interrupt the process (timeout, network issue, or manual interruption)
- The tool call gets saved to the session
.jsonlfile with a malformed structure - Send any new message — it will "think" but return a blank response
- Check the session file or logs for the error:
messages.X.content.Y.tool_use.input: Field required
Expected behavior
- OpenClaw should validate tool call structures before saving to the session file
- Malformed tool calls should not be persisted
- If a corrupted message exists, OpenClaw should detect and recover (or at least warn the user)
Actual behavior
- Malformed
tool_useblock is saved to session (missinginputfield) - Every subsequent API request includes the corrupted history
- Claude API rejects with:
messages.X.content.Y.tool_use.input: Field required - User sees "thinking" indicator but blank response
- Error cascades — each retry adds another error message to the session, making it worse
Environment
- OpenClaw version: 2026.1.29
- OS: macOS 26.2 (arm64)
- Install method: npm (
npm i -g openclaw@latest) - Model: google-antigravity/claude-opus-4-5-thinking
- Node: v24.8.0
Logs or screenshots
Error in session file:
messages.237.content.1.tool_use.input: Field required
Corrupted message structure (note missing input on second toolCall):
{
"id": "e775c1a3",
"message": {
"role": "assistant",
"content": [
{"type": "text", "text": "..."},
{"type": "tool_use", "id": "toolu_123", "name": "browser", "input": {...}},
{"type": "tool_use", "id": "toolu_456", "name": "exec"}
]
}
}Note: The second tool_use block is missing the required input field.
Frequency: Happened twice in one day during normal usage (browser automation and exec commands).
Workaround
Manually repair the session file by removing the corrupted message and all descendants:
# Find the corrupted line and truncate the session
# Backup first, then remove from the corrupted message onwardsSuggested Fix
- Validate before saving: Check that all
tool_useblocks have required fields (id,name,input) before persisting to the session file - Graceful recovery: If API returns this specific validation error, auto-rollback to last known good state
- Session checkpoints: Periodic snapshots that can be restored
This issue was identified with AI assistance (Claude via OpenClaw). The analysis and reproduction steps have been verified by the user.