[Bug] Anthropic API Error: Cannot modify thinking blocks in assistant messages
Resolved 💬 3 comments Opened Apr 24, 2026 by nktrapp Closed Apr 28, 2026
Bug Description
got error: API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.1.content.42: 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_011CaNYN3V7nCZPXyhvXrmxw"}
Environment Info
- Platform: darwin
- Terminal: Apple_Terminal
- Version: 2.1.118
- Feedback ID: 14e5ec5d-1df6-4828-8af1-39e6bd1dddfb
Errors
[{"error":"Error: EISDIR: illegal operation on a directory, read '/Users/nikolastrapp/projects/trapp-generator'\n at n1H (/$bunfs/root/src/entrypoints/cli.js:1698:144)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-23T23:05:22.796Z"},{"error":"Error: 429 {\"type\":\"error\",\"error\":{\"type\":\"rate_limit_error\",\"message\":\"This request would exceed your account's rate limit. Please try again later.\"},\"request_id\":\"req_011CaMd1XA1CVTsenkPz2Hb3\"}\n at generate (/$bunfs/root/src/entrypoints/cli.js:11:55186)\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-24T00:07:12.994Z"},{"error":"Error: 429 {\"type\":\"error\",\"error\":{\"type\":\"rate_limit_error\",\"message\":\"This request would exceed your account's rate limit. Please try again later.\"},\"request_id\":\"req_011CaMmDeXHEaECbmH6ZJhiQ\"}\n at generate (/$bunfs/root/src/entrypoints/cli.js:11:55186)\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-24T01:54:52.260Z"},{"error":"Error: 429 {\"type\":\"error\",\"error\":{\"type\":\"rate_limit_error\",\"message\":\"This request would exceed your account's rate limit. Please try again later.\"},\"request_id\":\"req_011CaMmLWaVQAhioA5wXzoSX\"}\n at generate (/$bunfs/root/src/entrypoints/cli.js:11:55186)\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-24T01:56:25.144Z"},{"error":"Error: 429 {\"type\":\"error\",\"error\":{\"type\":\"rate_limit_error\",\"message\":\"This request would exceed your account's rate limit. Please try again later.\"},\"request_id\":\"req_011CaMpLM186MhGwj3hFmQno\"}\n at generate (/$bunfs/root/src/entrypoints/cli.js:11:55186)\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-24T02:35:43.840Z"},{"error":"Error: 429 {\"type\":\"error\",\"error\":{\"type\":\"rate_limit_error\",\"message\":\"This request would exceed your account's rate limit. Please try again later.\"},\"request_id\":\"req_011CaMstPBaapBrn4MC8gXWd\"}\n at generate (/$bunfs/root/src/entrypoints/cli.js:11:55186)\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:4943)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-24T03:22:18.495Z"},{"error":"Error: Request was aborted.\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:50:3448)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-04-24T11:31:04.870Z"},{"error":"Error: ensureToolResultPairing: repaired missing tool_result blocks (21 -> 21 messages). Message structure: [0] user; [1] user; [2] assistant(id=msg_01BRLrfWoRMsNuD9KeVtQXe9, tool_uses=[toolu_01WNUkkgZ4saLNXvA1zfnxrK,toolu_0159kWD6hRw5hMVzDxFphjDB]); [3] user(tool_results=[toolu_01WNUkkgZ4saLNXvA1zfnxrK,toolu_0159kWD6hRw5hMVzDxFphjDB]); [4] assistant(id=msg_01HiW3NeTnuSLryT4ud85pcn, tool_uses=[toolu_01DuXkfXz8y4BiiUGs7V2EtZ,toolu_013Aq1ac6VGmNrzR2USqfgBZ]); [5] user(tool_results=[toolu_01DuXkfXz8y4BiiUGs7V2EtZ,toolu_013Aq1ac6VGmNrzR2USqfgBZ]); [6] assistant(id=msg_01TDU21KB8oo9TGSk6tubB4k, tool_uses=[toolu_01TMB4XxF3j1L6FyKstJdjNW,toolu_01U4AUanUVs2b8SahdWDAFEb]); [7] user(tool_results=[toolu_01TMB4XxF3j1L6FyKstJdjNW,toolu_01U4AUanUVs2b8SahdWDAFEb]); [8] assistant(id=msg_016gaRnxtPwgFQcTJJ9pQuDZ, tool_uses=[toolu_019M5wjEthojLpVhi74xozPK,toolu_014qGaAMa3BmNQgxyr88bUjo]); [9] user(tool_results=[toolu_019M5wjEthojLpVhi74xozPK,toolu_014qGaAMa3BmNQgxyr88bUjo]); [10] assistant(id=msg_01JdQ9FJ84btmoVt4qPKqJ9j, tool_uses=[toolu_01D8nxCZMw6ywfYjuGNSEbKC,toolu_01LwThFvzzaAfem84RzxBcmj]); [11] user(tool_results=[toolu_01D8nxCZMw6ywfYjuGNSEbKC,toolu_01LwThFvzzaAfem84RzxBcmj]); [12] assistant(id=msg_017vWbzejDB5nSbGDFLSLpVo, tool_uses=[toolu_01HL3CuvkmKPqTEGVuggCSHJ]); [13] user(tool_results=[toolu_01HL3CuvkmKPqTEGVuggCSHJ]); [14] assistant(id=msg_018JrApCwu3NZdNoDrvYS9En, tool_uses=[toolu_01V3thPj7uFKKwmL7Mb3yUx6,toolu_01QHSTi5E54sQ2BGGwnj7yxK]); [15] user(tool_results=[toolu_01V3thPj7uFKKwmL7Mb3yUx6,toolu_01QHSTi5E54sQ2BGGwnj7yxK]); [16] assistant(id=msg_0143AxE7rXLJXrbPmFgELRSX, tool_uses=[toolu_017B4s5BPTzuvWyUHaf8pf4b]); [17] user(tool_results=[toolu_017B4s5BPTzuvWyUHaf8pf4b]); [18] assistant(id=msg_01RzxRwLK1soZAKBXMk7zFro, tool_uses=[], serv…
Note: Content was truncated.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗