[Bug] Empty text block with cache_control causes unrecoverable session failure

Resolved 💬 3 comments Opened May 9, 2026 by cushler Closed May 13, 2026

Bug Description
Title: Empty text block with cache_control crashes session (claude-vscode 2.1.114) The harness emitted a message containing an empty text content block with a cache_control marker attached. Anthropic API rejects this with: messages.118.content.3.text: cache_control cannot be set for empty text blocks Once present in history, every subsequent request fails with the generic "messages: text content blocks must be non-empty" 400 error. Session is unrecoverable without /compact or /resume. Repro: unknown — happened mid-session in VS Code extension. No special tool use immediately prior; the user prompt was a typo'd one-liner ("should i import that file vback to ubo"). The next user input was a screenshot path paste, which retriggered the same broken history. Environment: - Claude Code: 2.1.114 - Entrypoint: claude-vscode - OS: Windows 11 Pro 26200 - Model: claude-opus-4-7 - Voice mode enabled, push notifications enabled - Session ID: ada39e50-1fd5-4573-a7ca-327d6b701c67 - Original request ID (the informative error): req_011CasSzrsb2REcHepmVewV4 - Subsequent request IDs: req_011CasT4Tq7KoxX2NuUyKbBw, req_011CasT6iD75gNYu94N36JwJ, req_011CasT7kZXBddp6F8RPXfyQ - Broken message index: 118, content block index: 3 Expected: harne

Environment Info

  • Platform: win32
  • Terminal: windows-terminal
  • Version: 2.1.114
  • Feedback ID: 92fc8097-eb24-4d32-9f9b-7982a840be80

Errors

[{"error":"Error: Request was aborted.\n    at makeRequest (B:/~BUN/root/src/entrypoints/cli.js:50:3448)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-05-09T18:17:15.320Z"}]

View original on GitHub ↗

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