API Error 400: thinking blocks modified in conversation history

Resolved 💬 3 comments Opened Jan 26, 2026 by borcezarinski Closed Jan 30, 2026

Bug Description

Getting an API error during normal conversation flow after MCP tool calls:

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.1.content.30: 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_011CXWDus5M1Up5Phhmiwv3K"}

Steps to Reproduce

  1. Have MCP servers configured (custom MCP with Trello integration)
  2. Use MCP tools during conversation
  3. Tool executes successfully and returns result
  4. Error appears after the tool result is processed

Expected Behavior

Conversation should continue normally after successful MCP tool execution.

Actual Behavior

The API returns a 400 error indicating that thinking blocks in the conversation history were modified, which is not allowed.

Environment

  • Platform: Linux (WSL2)
  • OS Version: Linux 6.6.87.2-microsoft-standard-WSL2
  • Model: claude-opus-4-5-20251101
  • Claude Code running in VSCode extension

Additional Context

  • The MCP tool itself executed successfully (Trello comment was created)
  • The error occurs during the subsequent API call to continue the conversation
  • Starting a fresh conversation resolves the issue temporarily
  • The error message references messages.1.content.30, suggesting a specific content block in the conversation history

This appears to be an issue with conversation state management where thinking blocks are being inadvertently modified when processing tool results.

View original on GitHub ↗

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