[Bug] Anthropic API Error: Cannot modify thinking blocks from different model versions

Resolved 💬 2 comments Opened May 28, 2026 by xeonforcecz Closed Jun 30, 2026

Bug Description
Title: 400 "thinking blocks cannot be modified" when editing/rewinding history created under a different model (4.7 → 4.8) What happened: When a conversation contains thinking blocks generated by one model (e.g. Claude 4.7) and I then touch that history — switch models, edit a previous message, or rewind — the next request fails with: API Error: 400 messages.3.content.1: thinking or redacted_thinking blocks in the latest assistant message cannot be modified. These blocks must remain as they were in the original response. Repro steps: 1. Start a conversation with extended thinking under model 4.7 (so the history contains signed thinking blocks). 2. Switch the active model (e.g. to 4.8), and/or edit or rewind to a prior assistant turn. 3. Send the next message → 400 on the thinking block in the latest assistant message. Frequency: Reproducible — happens essentially every time history from 4.7 is touched after a model change/edit/rewind. Expected: The harness should not replay a thinking block signed by a different model as the latest assistant turn — it should strip or regenerate cross-model thinking blocks (or warn) rather than surface a raw 400. Editing/rewinding history that contains thinking should degrade gracefully. Likely cause: Thinking-block signatures are tied to the producing model. Re-submitting a 4.7-signed block into a turn handled by another model makes the API treat it as modified/foreign. Environment: - Claude Code, model switched from 4.7 to Opus 4.8 (1M context) - Platform: macOS (Darwin 25.5.0)

Environment Info

  • Platform: darwin
  • Terminal: phpstorm
  • Version: 2.1.154
  • Feedback ID: 626557c8-069a-4fbd-898a-b5a31176d073

Errors

[{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.13.content.7: `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_011CbVRHzxtGt7mDqrfzjN6d\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:63816)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:51:7694)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-05-28T18:12:47.516Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.13.content.7: `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_011CbVRbFSzZt5J1V3L6X19M\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:63816)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:51:7694)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-05-28T18:16:41.583Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.13.content.7: `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_011CbVReTuRj2SQAyqQRSJ5F\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:63816)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:51:7694)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-05-28T18:17:25.123Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.3.content.1: `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_011CbVRt8YVD4pBv7fC79ncc\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:63816)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:51:7694)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-05-28T18:20:30.525Z"}]

View original on GitHub ↗

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