You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Anthropic provider: empty tool_result content crashes with 'content field is empty' API error #15371
When a tool call returns an empty string, the Anthropic provider passes content: "" directly into the tool_result content block. The Anthropic API rejects this with:
Error: The content field in the Message object at messages.N is empty. Add a ContentBlock object to the content field and try again.
Location
packages/console/app/src/routes/zen/util/provider/anthropic.ts, in the role === "tool" branch:
Any tool that returns an empty string (e.g. a write-only tool, a command with no stdout, or a tool that errors silently) will trigger this. The error identifies the exact message index (e.g. messages.13), making it look like a history corruption issue rather than a missing guard.
Fix
content: (masany).content||"(no output)",
Or more robustly, filter/normalize before building the block:
Activity
fix(zen): guard against empty tool_result content in Anthropic provider
github-actions commentedon Apr 29, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.