[Bug] Anthropic API Error: Auto-compact modifies thinking blocks in assistant messages
Resolved 💬 3 comments Opened May 6, 2026 by MakDizdar Closed May 6, 2026
Bug Description
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.1.content.135: 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_011CamN6jBYXYjRDrEDBBSrf"},
auto-compact was enabled, can't continue session without restarting, compact should have avoided this yet it didnt.
Environment Info
- Platform: linux
- Terminal: tmux
- Version: 2.1.126
- Feedback ID: ac195500-84a3-4f33-8e44-7b747e1e9d8e
Errors
[{"error":"Error: ensureToolResultPairing: repaired missing tool_result blocks (1098 -> 1105 messages). Message structure: [0] user; [1] assistant(id=msg_01QzbRsA2kxzrV4K4nSux7Gg, tool_uses=[toolu_01Hbim6my8tbqXJGC2wMLVXV]); [2] user(tool_results=[toolu_01Hbim6my8tbqXJGC2wMLVXV]); [3] assistant(id=msg_01JrVuDHomxaaqvrU38yG8DC, tool_uses=[toolu_01JSLrge8JxXwgcwAC5GcyBr]); [4] user(tool_results=[toolu_01JSLrge8JxXwgcwAC5GcyBr]); [5] assistant(id=msg_01XhHqGjg6icxUVyUbeA6d8J, tool_uses=[toolu_01Gi9CJBa6SbrZUSApBSSMr7]); [6] user(tool_results=[toolu_01Gi9CJBa6SbrZUSApBSSMr7]); [7] assistant(id=msg_01JKZJ5XBscZ2QKBCt96v1Ua, tool_uses=[toolu_018nP56XKRG8yn2zed63FToR]); [8] user(tool_results=[toolu_018nP56XKRG8yn2zed63FToR]); [9] assistant(id=msg_01XdBsfANa7bkkomUjw4mjdP, tool_uses=[]); [10] user; [11] assistant(id=msg_01YYA6KL3EnrDdCveydMztgq, tool_uses=[toolu_01Jimt196cjBR8J6nQzjLG4K]); [12] user(tool_results=[toolu_01Jimt196cjBR8J6nQzjLG4K]); [13] assistant(id=msg_016Cwx3FSLkpw6BJm4NWsoao, tool_uses=[toolu_01BbZLFtLsq7A9EyHBLrafyL]); [14] user(tool_results=[toolu_01BbZLFtLsq7A9EyHBLrafyL]); [15] assistant(id=msg_01URSDm45zmNz8NurvGKbhgy, tool_uses=[toolu_01U5Z9Wi51ij536Dd1Cc1EtW]); [16] user(tool_results=[toolu_01U5Z9Wi51ij536Dd1Cc1EtW]); [17] assistant(id=msg_01DeiXSxVNgWKs3GCi5EdFJX, tool_uses=[toolu_01NuTvkgRnerSZdmAis6VUhs]); [18] user(tool_results=[toolu_01NuTvkgRnerSZdmAis6VUhs]); [19] assistant(id=msg_018Jea5UiifDRMkKkSCK853Y, tool_uses=[toolu_01XGzjiPcLsyAB171hBpX4xr]); [20] user(tool_results=[toolu_01XGzjiPcLsyAB171hBpX4xr]); [21] assistant(id=msg_01N8Zi4bUrfohWAMN7JDtDh3, tool_uses=[toolu_011bJTQx3KLyzQScU5hfaVXz]); [22] user(tool_results=[toolu_011bJTQx3KLyzQScU5hfaVXz]); [23] assistant(id=msg_01Hj2uRQiMqG5aGXbXdVEdpw, tool_uses=[toolu_01DkbHAqSVby1bVsrAaaGnXX]); [24] user(tool_results=[toolu_01DkbHAqSVby1bVsrAaaGnXX]); [25] assistant(id=msg_01JoYr8AL42phSKhKv12LNq7, tool_uses=[toolu_01D9xT5FDoq4do7PxqcXm7j6]); [26] user(tool_results=[toolu_01D9xT5FDoq4do7PxqcXm7j6]); [27] assistant(id=msg_014gor8yy3pUKBEPjmaRbqWn, tool_uses=[toolu_01CEbQhpTc8tNNvTEp7FzWEV]); [28] user(tool_results=[toolu_01CEbQhpTc8tNNvTEp7FzWEV]); [29] assistant(id=msg_01SAbaANjivbZyU2g8qH5b9E, tool_uses=[toolu_01KaLCdihTuHMWQ7Yy7VK2yo]); [30] user(tool_results=[toolu_01KaLCdihTuHMWQ7Yy7VK2yo]); [31] assistant(id=msg_01Fh1BfEur8mQur1orpzPrHK, tool_uses=[toolu_017ngUqVywYzEtstnPQybpnu]); [32] user(tool_results=[toolu_017ngUqVywYzEtstnPQybpnu]); [33] assistant(id=msg_01NUi76pEMVGk3fwEN8kCDGu, tool_uses=[toolu_01Jqd5SB7pALVVAyPnkXNLL8]); [34] user(tool_results=[toolu_01Jqd5SB7pALVVAyPnkXNLL8]); [35] assistant(id=msg_01MzXK4CpCW1ZCW5iqbufKZF, tool_uses=[toolu_012PnLDPY1HrRpn77CZr644q]); [36] user(tool_results=[toolu_012PnLDPY1HrRpn77CZr644q]); [37] assistant(id=msg_012cDFRhMn5fnvg8qHE8zRtd, tool_uses=[toolu_01WYyJTCfNkcvcEraBM4ddKS]); [38] user(tool_results=[toolu_01WYyJTCfNkcvcEraBM4ddKS]); [39] assistant(id=msg_017Znxdg1WoJMUix2voRpM8h, tool_uses=[toolu_019Gce4x1RkaabMeuUUK3HHm]); [40] user(tool_results=[toolu_019Gce4x1RkaabMeuUUK3HHm]); [41] assistant(id=msg_01ESAPd1qcsyqDLPhPDzHXRH, tool_uses=[toolu_01AAJhXqSGnEFCHvvfqYMuuz]); [42] user(tool_results=[toolu_01AAJhXqSGnEFCHvvfqYMuuz]); [43] assistant(id=msg_01XfZ1avBx14m3VzG9bTec2h, tool_uses=[toolu_01AgBomv2PCxRjJs6DaR2Rha]); [44] user(tool_results=[toolu_01AgBomv2PCxRjJs6DaR2Rha]); [45] assistant(id=msg_01FS6DPMvUAXnm4ozKPnMjsg, tool_uses=[]); [46] user; [47] assistant(id=msg_01DqxgCgDBSXkV3bybnrbhTZ, tool_uses=[toolu_01LQAF1kWmUPYgDXTg6rT5rs]); [48] user(tool_results=[toolu_01LQAF1kWmUPYgDXTg6rT5rs]); [49] assistant(id=msg_014SttMtSgprZmaLMPjiRuBe, tool_uses=[toolu_01JFySsYUrWNAETJ6deUEgRM]); [50] user(tool_results=[toolu_01JFySsYUrWNAETJ6deUEgRM]); [51] assistant(id=msg_016xNXHNugoDVtrJrUUJY2vM, tool_uses=[toolu_01V1wLFcR6Lya85tQccocZ2g]); [52] user(tool_results=[toolu_01V1wLFcR6Lya85tQccocZ2g]); [53] assistant(id=msg_01F1miuGMwcfVUziAkYjpxRA, tool_uses=[toolu_01UBA3Pj77GWCovrvKUhMZ9B]); [54] user(tool_results=[toolu_01UBA3Pj77GWCovrvKUhMZ9B]); [55] assistant(id=msg_012vaegq3rYDK3U5Tzb4SAui, tool_uses=[toolu_01FVg52bf3Fk4jbgjRCVvsBR]); [56] user(tool_results=[toolu_01FVg52bf3Fk4jbgjRCVvsBR]); [57] assistant(id=msg_019nMriU4HwqUMd5Y6DQU78k, tool_uses=[toolu_018yqcxyLkK5VZYefjNkkVF6]); [58] user(tool_results=[toolu_018yqcxyLkK5VZYefjNkkVF6]); [59] assistant(id=msg_0196mNr9Q5XwoMbt2MyajH1o, tool_uses=[toolu_01PSNWg2ydmTqRfLpdrrXqX9]); [60] user(tool_results=[toolu_01PSNWg2ydmTqRfLpdrrXqX9]); [61] assistant(id=msg_01V4o6BVxYmSMeMUi3aN8ErC, tool_uses=[toolu_01VnSbE2wC19tUMTUACvBot2]); [62] user(tool_results=[toolu_01VnSbE2wC19tUMTUACvBot2]); [63] assistant(id=msg_01MWccjEW4PhtezFwDCWb7A3, tool_uses=[toolu_01RAun1yCz5XchF44vSDzHfW]); [64] user(tool_results=[toolu_01RAun1yCz5XchF44vSDzHfW]); [65] assistant(id=msg_01Tq31tiqh…
Note: Content was truncated.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗