[BUG] API Error when continuing conversation with thinking blocks

Resolved 💬 3 comments Opened Jan 1, 2026 by rhilo Closed Feb 26, 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?

Extension appears to be modifying or incorrectly reconstructing the thinking blocks when building the message history for the next API request, causing the API to reject it.

Error persists across multiple attempts in the same conversation. Starting a new chat works fine. The error specifically mentions messages.5.content.4, suggesting the 6th message's 5th content block (a thinking block) is being modified.

What Should Happen?

Conversation should continue normally

Error Messages/Logs

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.5.content.4: thinking or redacted_thinking blocks in the latest assistant message cannot be modified. These blocks must remain as they were in the original response."},"request_id":"req_011CWhPhWSHB95e6uNGSPFix"}

Steps to Reproduce

  1. Start a conversation with Claude Code
  2. Claude responds with extended thinking (visible thinking blocks in the chat)
  3. User sends a follow-up message
  4. Extension throws the above API error repeatedly

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.6.75 (CLaude Code for VS Code

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

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