[Bug] Anthropic API Error: Cannot modify thinking blocks in assistant messages
Resolved 💬 3 comments Opened Feb 17, 2026 by AmirK-S Closed Feb 21, 2026
Bug Description
wtf idk what's going on, API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.5.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_011CYDiyJrzov53mKJNAsxJu"}
Environment Info
- Platform: darwin
- Terminal: Apple_Terminal
- Version: 2.1.44
- Feedback ID: ab84a381-02ed-4fe6-ae1a-eceb467f1496
Errors
[{"error":"Error: ensureToolResultPairing: repaired missing tool_result blocks (102 -> 108 messages). Message structure: [0] user; [1] assistant(id=msg_01KKehHN3muvxtNiMLV3WjWE, tool_uses=[toolu_01NmJowGJtvpovKAqLXupJrX]); [2] user(tool_results=[toolu_01NmJowGJtvpovKAqLXupJrX]); [3] assistant(id=msg_016nxrmgDrcXJmeKmEDgWVSf, tool_uses=[toolu_01DVj5w6tZf1giKHKTgJxpiv]); [4] user(tool_results=[toolu_01DVj5w6tZf1giKHKTgJxpiv]); [5] assistant(id=msg_01KBpdqtafz4b5rb7UAjm5UE, tool_uses=[toolu_01Ds5gp6pJVgdDT11RfQd3Bf]); [6] user(tool_results=[toolu_01Ds5gp6pJVgdDT11RfQd3Bf]); [7] assistant(id=msg_01PfeUg6rYsUYaUcYNWxCc72, tool_uses=[toolu_011szcmJpkAWuEWiDXXojaY7]); [8] user(tool_results=[toolu_011szcmJpkAWuEWiDXXojaY7]); [9] assistant(id=msg_01EfEtVHZzbS9Y9eWGncKbuu, tool_uses=[toolu_017gvPVAx8bFG6mVqNpkDFef]); [10] user(tool_results=[toolu_017gvPVAx8bFG6mVqNpkDFef]); [11] assistant(id=msg_01489oEMhdmSxzknfQr2GRqx, tool_uses=[toolu_017aDxxBPw7DGf2KtZYjc387]); [12] user(tool_results=[toolu_017aDxxBPw7DGf2KtZYjc387]); [13] assistant(id=msg_01S7JvG5XXzrdTz7RycruqKv, tool_uses=[toolu_01VRC4G3Z8d9pREhUwWBoWVD]); [14] user(tool_results=[toolu_01VRC4G3Z8d9pREhUwWBoWVD]); [15] assistant(id=msg_01KCz4jdPhkt7oCNdpzwQMMM, tool_uses=[toolu_01KhN69hUSLSqBUddVt6CPzE]); [16] user(tool_results=[toolu_01KhN69hUSLSqBUddVt6CPzE]); [17] assistant(id=msg_01HGKcwDBM6vqGLMhGQJd39U, tool_uses=[toolu_01JNxm64QPvC8Au5nqU43rRE]); [18] user(tool_results=[toolu_01JNxm64QPvC8Au5nqU43rRE]); [19] assistant(id=msg_01CpaQSJorw6PdqjNmKBXMMP, tool_uses=[toolu_01EDtKxbkQzTN1mbtc2HkaCD]); [20] assistant(id=msg_019hMMdU6xHCu9j9bipmQ3JF, tool_uses=[toolu_011X5c97VSHgEzU1aaUeGNnd]); [21] user(tool_results=[toolu_011X5c97VSHgEzU1aaUeGNnd]); [22] assistant(id=msg_017mZ7pGcbzaNNyqXeLmxWF7, tool_uses=[toolu_01EjQP6Gfd56pCpM8G8KDrNH]); [23] user(tool_results=[toolu_01EDtKxbkQzTN1mbtc2HkaCD]); [24] assistant(id=msg_01UFAytBmHVcp8QtCyWUPL2u, tool_uses=[toolu_01ELbXemLZWTtV8k9uabLj9J]); [25] user(tool_results=[toolu_01EjQP6Gfd56pCpM8G8KDrNH]); [26] assistant(id=msg_01PULTemqisKodV9fPL8XY8h, tool_uses=[toolu_018KKXQa4Vb9UumnGhdUi7pX]); [27] user(tool_results=[toolu_01ELbXemLZWTtV8k9uabLj9J,toolu_018KKXQa4Vb9UumnGhdUi7pX]); [28] assistant(id=msg_01W9rWmnm7iLhtdBLXKDhKfT, tool_uses=[toolu_01Ux7yNb3rQ5B51k9GgHG1p4]); [29] user(tool_results=[toolu_01Ux7yNb3rQ5B51k9GgHG1p4]); [30] assistant(id=msg_01RkgQ45CxuevBGrdJ1NK24t, tool_uses=[toolu_01AejqciWARfRpQeSdMhLiYn]); [31] user(tool_results=[toolu_01AejqciWARfRpQeSdMhLiYn]); [32] assistant(id=msg_01TF5htuGYikWjowzWMaLo7j, tool_uses=[toolu_01RHT6FsjLivry7f9jNaUgZF]); [33] assistant(id=msg_0145atCh8jRPafqvBRXe3bo2, tool_uses=[toolu_01FrW7Z9AS2yDbdvkQUHcpoQ]); [34] user(tool_results=[toolu_01FrW7Z9AS2yDbdvkQUHcpoQ]); [35] assistant(id=msg_01DToJiiEHRowZKmodAB5pba, tool_uses=[toolu_01BnqGcYfVEZkazsaFf1nzKL]); [36] user(tool_results=[toolu_01BnqGcYfVEZkazsaFf1nzKL,toolu_01RHT6FsjLivry7f9jNaUgZF]); [37] assistant(id=msg_01XkbNT3K5cp38rstvp7Kmcc, tool_uses=[toolu_01PSrcUeLZELet3g7zNCoTb6]); [38] user(tool_results=[toolu_01PSrcUeLZELet3g7zNCoTb6]); [39] assistant(id=msg_01AFdDybvv7m9nA6bsYRvXa9, tool_uses=[toolu_0184fCD5y2SaG6Mkvx4tisM2]); [40] assistant(id=msg_01HCjGCxfvq4W4nbveaSbcCN, tool_uses=[toolu_015kn5FE82NoPLa29Am2RMQT]); [41] user(tool_results=[toolu_015kn5FE82NoPLa29Am2RMQT]); [42] assistant(id=msg_01RYFHBEAFkN39FT9RUUQHaG, tool_uses=[toolu_017or4gs2t7fS1arJ3MFfUXf]); [43] user(tool_results=[toolu_017or4gs2t7fS1arJ3MFfUXf,toolu_0184fCD5y2SaG6Mkvx4tisM2]); [44] assistant(id=msg_012RhFyK9Jsx6GtgXZRdX6b2, tool_uses=[]); [45] assistant(id=msg_011bk3sbndtrBWA26GL4c9CE, tool_uses=[toolu_013uLv9pNViTrzX3fj9fEqQA]); [46] assistant(id=msg_012RhFyK9Jsx6GtgXZRdX6b2, tool_uses=[toolu_017vDzwUpcqKxLi5Dcs9XdLz]); [47] user(tool_results=[toolu_013uLv9pNViTrzX3fj9fEqQA]); [48] assistant(id=msg_014mcjBehQ2zNbFsXyCzTX28, tool_uses=[toolu_01UeDBPNL6Bgnihh5mBJx6ss]); [49] user(tool_results=[toolu_017vDzwUpcqKxLi5Dcs9XdLz,toolu_01UeDBPNL6Bgnihh5mBJx6ss]); [50] assistant(id=msg_01WgxGuFQ3ZWgzJoWeoqzNv4, tool_uses=[toolu_01DGeu6tKGsBkxWsg9gn9u4M]); [51] assistant(id=msg_01P5L2W8e6QQKFxbE1DcLE9V, tool_uses=[toolu_017YkJoruqkQU25nJZ18GPJb]); [52] user(tool_results=[toolu_01DGeu6tKGsBkxWsg9gn9u4M,toolu_017YkJoruqkQU25nJZ18GPJb]); [53] assistant(id=msg_012TXbq72dHBoAY2ndiK4RvL, tool_uses=[toolu_01VKUZtshfXCKUqHFBU96CEv]); [54] user(tool_results=[toolu_01VKUZtshfXCKUqHFBU96CEv]); [55] assistant(id=msg_01BLw93iEp8ofZCBdXVaczS4, tool_uses=[toolu_013cRQUj2pvVwMSBxb7En593]); [56] assistant(id=msg_01TBpyQgQUNFcRCNRf9nVf8B, tool_uses=[toolu_01VSgL7tM4KtL9ScQBQzzHEP]); [57] user(tool_results=[toolu_01VSgL7tM4KtL9ScQBQzzHEP]); [58] assistant(id=msg_01D7VgUpzwDqh8rQwSg8TXXr, tool_uses=[toolu_01DfHBhcg4bmzMWbLVrErfUd]); [59] user(tool_results=[toolu_01DfHBhcg4bmzMWbLVrErfUd]); [60] assistant(id=msg_015txdASMRhPkz5VjsswNc4v, tool_uses=[toolu_01RoqyM7Tck1NgtVtviAZy3g]); [61] user(tool_results=[toolu_0…
Note: Content was truncated.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗