[Bug] Anthropic API Error: Tool Result Block Missing Corresponding Tool Use Block
Bug Description
⎿ API Error: 400
{"type":"error","error":{"type":"invalid_request_error","message":"messages.0.content.0:
unexpected tool_use_id found in tool_result blocks: toolu_01ARtxYjT8Cd9oyBfd4eYHsz.
Each tool_result block must have a corresponding tool_use block in the previous
message."},"request_id":"req_011CYAQ283V4b4ZjjSriAWF5"}
❯ TTETEETE
⎿ API Error: 400
{"type":"error","error":{"type":"invalid_request_error","message":"messages.0.content.0:
unexpected tool_use_id found in tool_result blocks: toolu_01ARtxYjT8Cd9oyBfd4eYHsz.
Each tool_result block must have a corresponding tool_use block in the previous
message."},"request_id":"req_011CYAQ2yGRFMcjE9UbJnuF3"}
Environment Info
- Platform: darwin
- Terminal: ghostty
- Version: 2.1.42
- Feedback ID: f242a627-b217-4398-9132-bd182ed39973
Errors
[{"error":"Error: File does not exist.\n at call (/$bunfs/root/claude:1309:6225)\n at async <anonymous> (/$bunfs/root/claude:5821:1670)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-02-15T18:54:10.898Z"},{"error":"FileTooLargeError: File content (639KB) exceeds maximum allowed size (256KB). Please use offset and limit parameters to read specific portions of the file, or use the GrepTool to search for specific content.\n at oY_ (/$bunfs/root/claude:1139:402)\n at async Jz_ (/$bunfs/root/claude:1304:2402)\n at async call (/$bunfs/root/claude:1309:5930)\n at async <anonymous> (/$bunfs/root/claude:5821:1670)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-02-15T19:02:46.028Z"},{"error":"Error: Request was aborted.\n at g5R (/$bunfs/root/claude:869:100994)\n at next (native:1:11)\n at jeB (/$bunfs/root/claude:5566:5182)\n at next (native:1:11)\n at xeB (/$bunfs/root/claude:5571:9101)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-02-15T19:02:59.170Z"},{"error":"Error: File does not exist.\n at call (/$bunfs/root/claude:1309:6225)\n at async <anonymous> (/$bunfs/root/claude:5821:1670)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-02-15T19:04:40.937Z"},{"error":"Error: ensureToolResultPairing: repaired missing tool_result blocks (227 -> 228 messages). Message structure: [0] user; [1] assistant(id=msg_01NXDe9pTatezEtJ8ynNy8NS, tool_uses=[toolu_01WzMj1jer1sXhqzF14R9x7b]); [2] user(tool_results=[toolu_01WzMj1jer1sXhqzF14R9x7b]); [3] assistant(id=msg_01SXmpzXdbC283X3B7pmwij9, tool_uses=[toolu_01ARtxYjT8Cd9oyBfd4eYHsz]); [4] user(tool_results=[toolu_01ARtxYjT8Cd9oyBfd4eYHsz]); [5] assistant(id=msg_01BPcgLL76grNqP5qLFU3dBM, tool_uses=[toolu_01TQ93piX4cFSzWrysvMQmYM]); [6] user(tool_results=[toolu_01TQ93piX4cFSzWrysvMQmYM]); [7] assistant(id=msg_016i4NSnirLZ82EAaratDZiZ, tool_uses=[]); [8] user; [9] assistant(id=msg_01HJwiPYFYR2xMFai7BntgJE, tool_uses=[toolu_01GA72CXaiUAZfHEnX7NZ4Um]); [10] user(tool_results=[toolu_01GA72CXaiUAZfHEnX7NZ4Um]); [11] assistant(id=msg_0134awDceokdNGh2kwLBYksK, tool_uses=[toolu_013edW1dgmC4GmjPpqAoEJHP]); [12] user(tool_results=[toolu_013edW1dgmC4GmjPpqAoEJHP]); [13] assistant(id=msg_019G2ZFtou2FM3bdkbEspSYB, tool_uses=[toolu_01AzNjpVmF1zRK9fndq9ausK]); [14] user(tool_results=[toolu_01AzNjpVmF1zRK9fndq9ausK]); [15] assistant(id=msg_01HxQTTc5QBemcB9cxcoRkAF, tool_uses=[toolu_01XUXVjheEmAHwGEGvWmzPy3]); [16] user(tool_results=[toolu_01XUXVjheEmAHwGEGvWmzPy3]); [17] assistant(id=msg_01X6SbgRHzzNcQantyefKTH5, tool_uses=[toolu_01Wcbi3iEtnT5GBnvwWZPxiy]); [18] user(tool_results=[toolu_01Wcbi3iEtnT5GBnvwWZPxiy]); [19] assistant(id=msg_01QjTs6Wg2fwgcJrRWyExzLM, tool_uses=[toolu_013dBcxcCwWscFa4gnw6ZC9L]); [20] user(tool_results=[toolu_013dBcxcCwWscFa4gnw6ZC9L]); [21] assistant(id=msg_0133SpY5atkYgM3Uk58u8FZU, tool_uses=[toolu_01HKJyx9i6yWf6PJ5W8isNtd]); [22] user(tool_results=[toolu_01HKJyx9i6yWf6PJ5W8isNtd]); [23] assistant(id=msg_018Pefb4bh4tZ5joArpnGxHK, tool_uses=[toolu_011Pga9AG4FYCWBpg1ckCNwu]); [24] user(tool_results=[toolu_011Pga9AG4FYCWBpg1ckCNwu]); [25] assistant(id=msg_0166VJNdZzPpLB8woFsdRQvg, tool_uses=[toolu_01FVtAzwRjMjG2LeyMcbt7WM]); [26] user(tool_results=[toolu_01FVtAzwRjMjG2LeyMcbt7WM]); [27] assistant(id=msg_013PsnQcp8NdfKxe8kMbV9Cw, tool_uses=[toolu_017oGmtGYLXZPWgRK1QXp2AV]); [28] user(tool_results=[toolu_017oGmtGYLXZPWgRK1QXp2AV]); [29] assistant(id=msg_015BKnyHnTGcJBcevgbx6m7j, tool_uses=[toolu_01AAobgNvGqdqjxVEYz1tbNX]); [30] user(tool_results=[toolu_01AAobgNvGqdqjxVEYz1tbNX]); [31] assistant(id=msg_01QSw1cCq1696hTYBjeyaQ92, tool_uses=[toolu_01Lhdzg4utLB5ydKebeRgqCw]); [32] user(tool_results=[toolu_01Lhdzg4utLB5ydKebeRgqCw]); [33] assistant(id=msg_017FKaGUXNr87VWfxLe71f3B, tool_uses=[toolu_01V4GnEhV9fEmdhcuLEsyowU]); [34] user(tool_results=[toolu_01V4GnEhV9fEmdhcuLEsyowU]); [35] assistant(id=msg_01T7DGwuM5KgGtvHHJBdvS28, tool_uses=[toolu_017ys88RXRQuZMxGx8QkdsAL]); [36] user(tool_results=[toolu_017ys88RXRQuZMxGx8QkdsAL]); [37] assistant(id=msg_01L3sbxvyCcmjo8Vya94i67x, tool_uses=[toolu_01UoUPF4h2vuw4iUJwYfWktg]); [38] user(tool_results=[toolu_01UoUPF4h2vuw4iUJ…
Note: Content was truncated.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗