[BUG] cache_control cannot be set for empty text blocks at messages.N.content.1.text
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
request_id: req_011CaUi2ayLNCHz6AUbBYtoQ
Repro: paste screenshot from clipboard with no accompanying text
The fix is on their side (skip cache_control when text is empty) — not something patchable from a project repo.
400 invalid_request_error: cache_control cannot be set for empty text blocks
What Should Happen?
request_id: req_011CaUi2ayLNCHz6AUbBYtoQ
Repro: paste screenshot from clipboard with no accompanying text
The fix is on their side (skip cache_control when text is empty) — not something patchable from a project repo.
Error Messages/Logs
request_id: req_011CaUi2ayLNCHz6AUbBYtoQ
Repro: paste screenshot from clipboard with no accompanying text
The fix is on their side (skip cache_control when text is empty) — not something patchable from a project repo.
400 invalid_request_error: cache_control cannot be set for empty text blocks
Steps to Reproduce
Paste screenshot from clipboard with no accompanying text
request_id: req_011CaUi2ayLNCHz6AUbBYtoQ
Repro: paste screenshot from clipboard with no accompanying text
The fix is on their side (skip cache_control when text is empty) — not something patchable from a project repo.
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.119
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗