[Bug] Anthropic API Error: Empty text content blocks when sending images without accompanying text

Resolved 💬 2 comments Opened May 9, 2026 by Iam0x Closed May 9, 2026

Bug Description
Bug: API Error 400 — text content blocks must be non-empty when sending an image with no accompanying text in Claude Code (web).
Steps to reproduce: send an image without any text in the message. The request fails with the 400 above. The error persists across retries and a clean session, so it doesn't appear to be transient.
Suggested fix: allow image-only messages (no text required) on the web client, or have the client auto-fill a minimal text block before sending.

Environment Info

  • Platform: linux
  • Version: 2.1.138
  • Feedback ID: fa529de5-5c9e-4b52-a12c-1d65369e4c14

Errors

[{"error":"Error: NON-FATAL: Lock acquisition failed for /home/debian/.local/share/claude/versions/2.1.138 (expected in multi-process scenarios)\n    at a48 (/$bunfs/root/src/entrypoints/cli.js:2657:2257)\n    at vTH (/$bunfs/root/src/entrypoints/cli.js:2657:1337)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-05-09T22:08:15.229Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages: text content blocks must be non-empty\"},\"request_id\":\"req_011CasktjfBT7Svb8XqsssPK\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:58505)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:51:7694)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-05-09T22:08:22.078Z"}]

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗