[BUG][ANALYSIS] Missing Tool Result Blocks Interrupting Workflow Execution
Resolved 💬 8 comments Opened Aug 8, 2025 by almirsarajcic Closed Sep 18, 2025
Bug Description
The workflow stops for no reason. When I try to write a follow-up prompt, it reveals the "tool_use ids were found without tool_result blocks" error message. It prevents me from creating a truly autonomous workflow.
Environment Info
- Platform: darwin
- Terminal: cursor
- Version: 1.0.71
- Feedback ID: de619269-71e4-4a2d-8057-3df7bf61893e
Errors
[
{
"error": "Error: Request was aborted.\n at new sW (unknown:1:28)\n at new qY (/$bunfs/root/claude:876:1853)\n at new sJ (/$bunfs/root/claude:876:2641)\n at _createMessage (/$bunfs/root/claude:884:7955)\n at processTicksAndRejections (native:7:39)",
"timestamp": "2025-08-08T05:16:28.686Z"
},
{
"error": "Error: Request was aborted.\n at new sW (unknown:1:28)\n at new qY (/$bunfs/root/claude:876:1853)\n at new sJ (/$bunfs/root/claude:876:2641)\n at makeRequest (/$bunfs/root/claude:893:3652)\n at processTicksAndRejections (native:7:39)",
"timestamp": "2025-08-08T05:23:21.851Z"
},
{
"error": "Error: Error POSTing to endpoint (HTTP 404): Session not found\n at send (/$bunfs/root/claude:903:25507)\n at processTicksAndRejections (native:7:39)",
"timestamp": "2025-08-08T05:24:27.196Z"
},
{
"error": "Error: Error POSTing to endpoint (HTTP 404): Session not found\n at send (/$bunfs/root/claude:903:25507)\n at processTicksAndRejections (native:7:39)",
"timestamp": "2025-08-08T05:24:33.294Z"
},
{
"error": "Error: Error POSTing to endpoint (HTTP 404): Session not found\n at send (/$bunfs/root/claude:903:25507)\n at processTicksAndRejections (native:7:39)",
"timestamp": "2025-08-08T05:24:38.025Z"
},
{
"error": "Error: Error POSTing to endpoint (HTTP 404): Session not found\n at send (/$bunfs/root/claude:903:25507)\n at processTicksAndRejections (native:7:39)",
"timestamp": "2025-08-08T05:24:42.410Z"
},
{
"error": "Error: Error POSTing to endpoint (HTTP 404): Session not found\n at send (/$bunfs/root/claude:903:25507)\n at processTicksAndRejections (native:7:39)",
"timestamp": "2025-08-08T05:25:21.031Z"
},
{
"error": "Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.28: `tool_use` ids were found without `tool_result` blocks immediately after: toolu_018Ynj1mexLmRjfnRN5A3LHY. Each `tool_use` block must have a corresponding `tool_result` block in the next message.\"}}\n at new sW (unknown:1:28)\n at new qY (/$bunfs/root/claude:876:1853)\n at new ZW0 (unknown:1:28)\n at generate (/$bunfs/root/claude:876:2310)\n at makeRequest (/$bunfs/root/claude:893:5330)\n at processTicksAndRejections (native:7:39)",
"timestamp": "2025-08-08T05:31:57.165Z"
}
]
Analysis
Environment Coverage
Platform/Terminal/Version combinations affected:
- macOS: Apple Terminal (v1.0.62-64), Cursor (v1.0.67), iTerm.app (v1.0.51-59), VSCode
(v1.0.35-61), IntelliJ (v1.0.62), Warp (v1.0.53-55), ghostty (v1.0.53)
- Linux: GNOME terminal (v1.0.62-70), Konsole (v1.0.61), VSCode (v1.0.35-53), WSL-Archlinux
(v1.0.64)
- Windows: WSL Ubuntu + ZSH (v1.0.55), VSCode Integrated Terminal via WSL
Trigger Scenarios
When the error occurs:
- During API request timeouts (6/10 retry attempts)
- After workflow interruptions or unexpected CLI termination
- When processing files (PDF, markdown, large files >25,000 tokens)
- During tool use operations that get interrupted
- After auto-upgrading to newer versions (specifically v1.0.55)
- When sessions exceed ~2,400 tokens during compaction
- During endpoint testing with Swagger
- After git push operations with long request URLs
Key Insights
- Core Issue: API validation error requiring each tool_use block to have immediate corresponding
tool_result block
- Version Range: Affects versions from 0.2.14 through 1.0.71+ (widespread across all recent versions)
- Root Cause: Recent API changes made tool_use/tool_result block ordering requirements stricter
- Session Recovery: Error makes conversations unrecoverable, requiring complete restart
- Pattern: Consistently results in 400 Bad Request with identical error message
- Platform Impact: Primarily affects macOS users but occurs across all platforms
- Keychain Issues: Frequently accompanied by macOS keychain access failures
- Token Limits: Related to MaxFileReadTokenExceededError (41,425 tokens vs 25,000 limit)
- Timing Sensitivity: Often occurs when messages are sent at critical moments during tool execution
- Message Ordering: Issue stems from non-standard ordering of tool_use and tool_result blocks in API messages
Workarounds
For Users:
- Session Recovery: Edit
~/.claude/projects/[PROJECT]/[LATEST-SESSION-STORE].jsonand remove problematic message lines - Export/Restart: Export chat → clear conversation → restart CLI → reload exported file
- Use offset/limit parameters for large files
- Use GrepTool instead of reading entire files
- VPN if ISP blocking suspected
For Developers:
- Message Block Ordering Fix: Ensure API messages follow sequence: Tool Result Block → Text Block → Tool Request Block (per @johnewart in #473)
- Root Cause: Recent API changes made tool_use/tool_result block ordering requirements stricter
Reference Issues
Most Comprehensive Issues:
- https://github.com/anthropics/claude-code/issues/473 (oldest/most comprehensive with detailed workarounds and community discussion)
- https://github.com/anthropics/claude-code/issues/6836 (another meta/analysis issue)
Duplicate Issues (46):
- https://github.com/anthropics/claude-code/issues/2423
- https://github.com/anthropics/claude-code/issues/2630 (tool ID: toolu_01AxtNfsQwHEvRUTRnvcyxTn)
- https://github.com/anthropics/claude-code/issues/2697 (tool ID: toolu_01G2Q9aJ8Jgeu5B9pMBxB3Jn)
- https://github.com/anthropics/claude-code/issues/2704
- https://github.com/anthropics/claude-code/issues/2712 (tool ID: toolu_01UKxg45kCnpK3zszmhfPmB6)
- https://github.com/anthropics/claude-code/issues/3549
- https://github.com/anthropics/claude-code/issues/3564
- https://github.com/anthropics/claude-code/issues/3608
- https://github.com/anthropics/claude-code/issues/3632
- https://github.com/anthropics/claude-code/issues/3636
- https://github.com/anthropics/claude-code/issues/3637
- https://github.com/anthropics/claude-code/issues/3754 (tool ID: toolu_01T4rbEocUEcU3L1i8PmXfFF)
- https://github.com/anthropics/claude-code/issues/3860 (tool ID: toolu_0175bkViAT1GJvptv8DpEgbp)
- https://github.com/anthropics/claude-code/issues/3886 (tool ID: toolu_01LsN9eeWJqu83ZEn9MMz6kD)
- https://github.com/anthropics/claude-code/issues/3902 (feedback ID: 9d56e0c7-a321-45b7-a1ac-430f18f51f6e; tool IDs: toolu_015m4ArUNHceJXtPrpCNnK7L, toolu_01NQv98A7JdU62r8UxsPZecG)
- https://github.com/anthropics/claude-code/issues/3916 (feedback ID: 275e8e43-5c64-4003-97b3-82f72f7e9f76; tool IDs: toolu_01BFX9m1YmC5UoetsCDqPfQu, toolu_013YTebuvpj8eXVbJNPq3BUB)
- https://github.com/anthropics/claude-code/issues/3977 (feedback ID: 5c88895e-4454-444f-9f7b-709497747321; tool ID: toolu_01LDzXQkQWhwYy68hj2GGXva)
- https://github.com/anthropics/claude-code/issues/4454 (feedback ID: 27071de8-b2ef-4271-a795-5513badf7a26)
- https://github.com/anthropics/claude-code/issues/4466 (feedback ID: 6ec710d1-c771-450d-ab57-5469a0ed1841; tool ID: toolu_01FCHoHXsqvL3aD5eKGMbqhk)
- https://github.com/anthropics/claude-code/issues/4522 (feedback ID: 236ad358-9502-4227-82c8-b655ac6863ef)
- https://github.com/anthropics/claude-code/issues/4563 (feedback ID: 08fb3c9a-4031-4c13-9316-2c9cced75b7e)
- https://github.com/anthropics/claude-code/issues/4638 (feedback ID: bf371c61-3e3a-46c5-9a01-4ca383fa56f6)
- https://github.com/anthropics/claude-code/issues/4664 (feedback ID: f9ed41a6-451c-49dd-8f25-0fdb3bc7a897)
- https://github.com/anthropics/claude-code/issues/4798 (feedback ID: 22514987-f0c6-49ec-86d4-8259b159da01)
- https://github.com/anthropics/claude-code/issues/4825 (feedback ID: 028bb608-0413-42b9-92cb-4735616132aa; tool IDs: toolu_016V22G6g4bAjj63qYouNsy5, toolu_01FWRC6QMpe6bYVfV92CFSwq, toolu_01EPeY4jhznE8ipJCLiFTXiP)
- https://github.com/anthropics/claude-code/issues/4842 (tool IDs: toolu_01LRM9xs9ZGG4pcrUhcobks4, toolu_01LviFawtYc6VkX3LXTUQGqm)
- https://github.com/anthropics/claude-code/issues/5060 (tool ID: toolu_01AbmHJypDhKqBF7NKdRPJ6d)
- https://github.com/anthropics/claude-code/issues/5246 (tool ID: toolu_0164aoqd28of7CZLGvm6ftFU)
- https://github.com/anthropics/claude-code/issues/5317 (tool ID: toolu_01X1RwkGwrnZScGu9jcYSWgE)
- https://github.com/anthropics/claude-code/issues/5412 (feedback ID: e0ebdd7d-45c9-440b-b9f5-ddbffd1c02dc, tool ID: toolu_01Kjp7i9iF3xJ3z9aH4pSaRw)
- https://github.com/anthropics/claude-code/issues/5421 (feedback ID: b38531f3-761e-4413-a70a-4d99fcb8ef56, tool ID: toolu_015UYDCWdHa5hzUsT5ZKYu4X)
- https://github.com/anthropics/claude-code/issues/5424 (feedback ID: c2aec1a9-6adc-42db-bf98-d193be52208c, tool ID: toolu_015ZXgypVKGqFDCB2TtgNgSA)
- https://github.com/anthropics/claude-code/issues/5450 (feedback ID: 4d022565-35cf-49b6-b5b5-18c851762c62, tool IDs: toolu_01FCH49ioQnBrfftPQx5k1ZQ, toolu_01NeL74QdYMQm8DFGz5Pxj3A, toolu_01XirfUjk9RBjbf7UYmQEQPF)
- https://github.com/anthropics/claude-code/issues/5457 (feedback ID: 8df7365b-ee0e-43f7-82d4-e5cf57e3b1f0, tool ID: toolu_01LXaVjS1uzmJHt3mAgzCAFB)
- https://github.com/anthropics/claude-code/issues/5468 (feedback ID: 81e1d09b-9465-436f-9626-79e5e3d7029d, tool ID: toolu_01K8QZqobexTyG9nJacRS8CB)
- https://github.com/anthropics/claude-code/issues/5470 (tool ID: toolu_01RcEBxtdXQbxB4P61SPVLSx)
- https://github.com/anthropics/claude-code/issues/5476 (feedback ID: 51414647-3863-4f43-93d4-4fc0289c238c, tool ID: toolu_01PV1SAMEMizf5NAi6LXoTfn)
- https://github.com/anthropics/claude-code/issues/5479 (feedback ID: ecd3ffc7-daad-4d38-b3e6-163d0a58ec6c, tool ID: toolu_01TtqtoE6BkdCjrQPZtqCDbJ)
- https://github.com/anthropics/claude-code/issues/5509 (feedback ID: 6379df44-7b45-4b2c-adc5-9f7265fc1fce, tool ID: toolu_01EqqrC85cWcn92HsggWCakB)
- https://github.com/anthropics/claude-code/issues/5594 (tool ID: toolu_01WNUbHpQy2RWWdoBF8JnF3r)
- https://github.com/anthropics/claude-code/issues/5599 (feedback ID: a8872815-f182-4a9e-8327-baa359a493de, tool ID: toolu_019aLkVUFjyvChUtaKKnfbm6)
- https://github.com/anthropics/claude-code/issues/5662 (tool ID: toolu_01JX7gsswzmXeYhXg6F8wGRy)
- https://github.com/anthropics/claude-code/issues/5705 (tool ID: toolu_019MgEXFFrY5MHhv9PqJDRQe)
- https://github.com/anthropics/claude-code/issues/5713 (feedback ID: 2cd49952-e215-4e23-9f7e-ecbbcb0e2d6b, tool ID: toolu_013UyW5GhFet72wyp1nt5NrC)
- https://github.com/anthropics/claude-code/issues/5747 (contains details and comprehensive reproduction steps; tool ID: toolu_01Qu2dmLfdZPZRMYT4ntdMgG)
- https://github.com/anthropics/claude-code/issues/5765 (feedback ID: 64b3c820-a92f-4f83-bd5e-59a2645e0503, tool ID: toolu_014fEC2oCHupbJiNAK43yLQp)
- https://github.com/anthropics/claude-code/issues/5928 (feedback ID: 6808c3d8-7d28-4016-b90e-628b676b4666, tool ID: toolu_01VMttWDJu2L9onCw1ddoLQJ)
- https://github.com/anthropics/claude-code/issues/6348 (feedback ID: bfd09f21-abd5-4541-b003-1becd0001964, tool ID: toolu_01QuCm4cWTJYDtxkqiqheNe3)
Related Issues (9):
- https://github.com/anthropics/claude-code/issues/1608
- https://github.com/anthropics/claude-code/issues/1672
- https://github.com/anthropics/claude-code/issues/2464
- https://github.com/anthropics/claude-code/issues/2582
- https://github.com/anthropics/claude-code/issues/2600
- https://github.com/anthropics/claude-code/issues/2616
- https://github.com/anthropics/claude-code/issues/2627
- https://github.com/anthropics/claude-code/issues/2672
- https://github.com/anthropics/claude-code/issues/2728
This issue has 8 comments on GitHub. Read the full discussion on GitHub ↗