[BUG]

Resolved 💬 3 comments Opened Apr 26, 2026 by Regiospar Closed Apr 30, 2026

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?

Title: 400 cache_control cannot be set for empty text blocks – mid-session, recurring

Error:
API Error: 400 {"type":"error","error":{"type":"invalid_request_error",
"message":"messages.160.content.1.text: cache_control cannot be set
for empty text blocks"}}
request_id: req_011CaTDornigmk2rw76GuW2A

Reproduce:

  • Long session (>150 messages) with many tool calls
  • Error appears in subsequent message dispatches
  • Affects every new chat (user reports)
  • Workaround: start fresh session

Expected: Claude Code should not attach cache_control to empty text
blocks (e.g. assistant messages where text follows tool_use and is "").

What Should Happen?

Title: 400 cache_control cannot be set for empty text blocks – mid-session, recurring

Error:
API Error: 400 {"type":"error","error":{"type":"invalid_request_error",
"message":"messages.160.content.1.text: cache_control cannot be set
for empty text blocks"}}
request_id: req_011CaTDornigmk2rw76GuW2A

Reproduce:

  • Long session (>150 messages) with many tool calls
  • Error appears in subsequent message dispatches
  • Affects every new chat (user reports)
  • Workaround: start fresh session

Expected: Claude Code should not attach cache_control to empty text
blocks (e.g. assistant messages where text follows tool_use and is "").

Error Messages/Logs

Steps to Reproduce

Title: 400 cache_control cannot be set for empty text blocks – mid-session, recurring

Error:
API Error: 400 {"type":"error","error":{"type":"invalid_request_error",
"message":"messages.160.content.1.text: cache_control cannot be set
for empty text blocks"}}
request_id: req_011CaTDornigmk2rw76GuW2A

Reproduce:

  • Long session (>150 messages) with many tool calls
  • Error appears in subsequent message dispatches
  • Affects every new chat (user reports)
  • Workaround: start fresh session

Expected: Claude Code should not attach cache_control to empty text
blocks (e.g. assistant messages where text follows tool_use and is "").

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

don't know!

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Terminal.app (macOS)

Additional Information

FIX!!!!

View original on GitHub ↗

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