[Bug] Anthropic API Error: Cannot modify thinking blocks in assistant message during compaction

Resolved 💬 3 comments Opened Dec 13, 2025 by jlmacedo Closed Dec 17, 2025

Bug Description
Error: Error: Error during compaction: Error: API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.5.content.45: 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_011CW5S4xGyJXtWGWM24mGF9"}

Environment Info

  • Platform: win32
  • Terminal: pycharm
  • Version: 2.0.59
  • Feedback ID: 4bf21284-7b2a-47c1-b51e-eaa5a2ff3f1a

Errors

[{"error":"Error\n    at TO (B:/~BUN/root/claude.exe:173:1143)\n    at <anonymous> (B:/~BUN/root/claude.exe:174:10086)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:861:50)\n    at processTicksAndRejections (native:7:39)\n    at request (B:/~BUN/root/claude.exe:176:2147)\n    at processTicksAndRejections (native:7:39)","timestamp":"2025-12-13T15:13:01.102Z"},{"error":"Error\n    at TO (B:/~BUN/root/claude.exe:173:1143)\n    at <anonymous> (B:/~BUN/root/claude.exe:174:10086)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:861:50)\n    at processTicksAndRejections (native:7:39)\n    at request (B:/~BUN/root/claude.exe:176:2147)\n    at processTicksAndRejections (native:7:39)","timestamp":"2025-12-13T15:13:01.133Z"},{"error":"Error\n    at TO (B:/~BUN/root/claude.exe:173:1143)\n    at <anonymous> (B:/~BUN/root/claude.exe:174:10086)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:861:50)\n    at processTicksAndRejections (native:7:39)\n    at request (B:/~BUN/root/claude.exe:176:2147)\n    at processTicksAndRejections (native:7:39)","timestamp":"2025-12-13T15:13:02.778Z"},{"error":"Error\n    at TO (B:/~BUN/root/claude.exe:173:1143)\n    at <anonymous> (B:/~BUN/root/claude.exe:174:10086)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:861:50)\n    at processTicksAndRejections (native:7:39)\n    at request (B:/~BUN/root/claude.exe:176:2147)\n    at processTicksAndRejections (native:7:39)","timestamp":"2025-12-13T15:13:04.579Z"},{"error":"Error: NON-FATAL: Lock acquisition failed for C:\\Users\\jlmac\\.local\\share\\claude\\versions\\2.0.65 (expected in multi-process scenarios)\n    at IzD (B:/~BUN/root/claude.exe:2634:1622)\n    at bFA (B:/~BUN/root/claude.exe:2632:35597)\n    at async hE9 (unknown)\n    at async ek (unknown)\n    at unknown\n    at processTicksAndRejections (native:7:39)","timestamp":"2025-12-13T15:13:25.756Z"},{"error":"AbortError: The operation was aborted.\n    at unknown\n    at abortChildProcess (node:child_process:947:42)\n    at onAbortListener2 (node:child_process:35:24)\n    at abort (unknown)\n    at <anonymous> (B:/~BUN/root/claude.exe:4307:2197)","timestamp":"2025-12-13T15:21:24.107Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.5.content.45: `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_011CW5QoLztpdK6hF6AazgdZ\"}\n    at generate (B:/~BUN/root/claude.exe:108:10367)\n    at makeRequest (B:/~BUN/root/claude.exe:1216:5434)\n    at processTicksAndRejections (native:7:39)","timestamp":"2025-12-13T21:39:45.194Z"},{"error":"Error: API Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.5.content.45: `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_011CW5QoLztpdK6hF6AazgdZ\"}\n    at CE$ (B:/~BUN/root/claude.exe:1832:1581)\n    at async QfD (unknown)\n    at processTicksAndRejections (native:7:39)","timestamp":"2025-12-13T21:39:45.230Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.5.content.45: `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_011CW5QpwZoLLSFSpYdqu56P\"}\n    at generate (B:/~BUN/root/claude.exe:108:10367)\n    at makeRequest (B:/~BUN/root/claude.exe:1216:5434)\n    at processTicksAndRejections (native:7:39)","timestamp":"2025-12-13T21:40:06.809Z"},{"error":"Error: API Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.5.content.45: `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\":\"

Note: Error logs were truncated.

View original on GitHub ↗

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