[Bug] Anthropic API Error: Cannot modify thinking blocks in assistant messages

Resolved 💬 2 comments Opened May 28, 2026 by TpmyCT Closed Jul 1, 2026

Bug Description
API Error: 400 messages.1.content.19: thinking or redacted_thinking blocks in the latest assistant message cannot be modified. These blocks must remain as they were in the original response.

Environment Info

  • Platform: linux
  • Terminal: xterm-256color
  • Version: 2.1.154
  • Feedback ID: 3fda782f-a2bb-4150-b52b-0c35fb4defbb

Errors

[{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.1.content.22: `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_011CbVSDQuGWur76VECAzsz7\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:63571)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:51:7694)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-05-28T18:24:52.203Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.1.content.22: `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_011CbVSGZP64Q6k9AfeoRahb\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:63571)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:51:7694)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-05-28T18:25:34.889Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.1.content.22: `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_011CbVSJq3UZpeEKzVQbwd7m\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:63571)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:51:7694)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-05-28T18:26:05.999Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.1.content.22: `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_011CbVSnH4uEkFLp9B6h4bZ8\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:63571)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:51:7694)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-05-28T18:32:18.503Z"},{"error":"Error: Tool bash not found\n    at x54 (/$bunfs/root/src/entrypoints/cli.js:4036:14129)\n    at vz (/$bunfs/root/src/entrypoints/cli.js:580:21150)\n    at qj (/$bunfs/root/src/entrypoints/cli.js:580:39922)\n    at SKH (/$bunfs/root/src/entrypoints/cli.js:580:50731)\n    at b8 (/$bunfs/root/src/entrypoints/cli.js:580:87760)\n    at IKH (/$bunfs/root/src/entrypoints/cli.js:580:86726)\n    at Wn (/$bunfs/root/src/entrypoints/cli.js:580:86546)\n    at rC (/$bunfs/root/src/entrypoints/cli.js:580:82882)\n    at Y$ (/$bunfs/root/src/entrypoints/cli.js:580:6440)\n    at lw6 (/$bunfs/root/src/entrypoints/cli.js:573:5415)","timestamp":"2026-05-28T18:33:22.821Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.1.content.19: `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_011CbVT3caL8eWChmyBDXiXn\"}\n    at generate (/$bunfs/root/src/entrypoints/cli.js:11:63571)\n    at makeRequest (/$bunfs/root/src/entrypoints/cli.js:51:7694)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-05-28T18:35:46.280Z"}]

View original on GitHub ↗

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