Skip to content

Missing Tool Result Block for Unresolved Tool Use #1856

@theoks

Description

@theoks

Bug Description
I interrupted the model and then asked it to continue and it continuously throws the following error, even after restarting the terminal:

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.109: tool_use ids were found without
tool_result blocks immediately after: toolu_01EkJ9RBB4DzBJ4Niii1atLP. Each tool_use block must have a corresponding
tool_result block in the next message."}}

Environment Info

  • Platform: macos
  • Terminal: iTerm.app
  • Version: 1.0.17
  • Feedback ID: 8ed11b3a-42c8-4ded-9fe7-93c0f65c9d2a

Errors

[{"error":"Error: Command failed: security find-generic-password -a $USER -w -s \"Claude Code\"\nsecurity: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.\n\n    at genericNodeError (node:internal/errors:983:15)\n    at wrappedFn (node:internal/errors:537:14)\n    at checkExecSyncError (node:child_process:882:11)\n    at execSync (node:child_process:954:15)\n    at YZ (file:///Users/theo/.nvm/versions/node/v22.16.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:654:3921)\n    at file:///Users/theo/.nvm/versions/node/v22.16.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:582:11794\n    at Q (file:///Users/theo/.nvm/versions/node/v22.16.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:526:17190)\n    at cJ (file:///Users/theo/.nvm/versions/node/v22.16.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:582:10940)\n    at aP (file:///Users/theo/.nvm/versions/node/v22.16.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:582:10021)\n    at a6 (file:///Users/theo/.nvm/versions/node/v22.16.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:582:14133)","timestamp":"2025-06-09T18:28:15.764Z"},{"error":"Error: No logs found at /Users/theo/Library/Caches/claude-cli-nodejs/MyProject/messages\n    at eT4 (file:///Users/theo/.nvm/versions/node/v22.16.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:583:3738)\n    at rQ1 (file:///Users/theo/.nvm/versions/node/v22.16.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:583:3487)\n    at SAA.<anonymous> (file:///Users/theo/.nvm/versions/node/v22.16.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:2339:2076)\n    at async SAA.parseAsync (file:///Users/theo/.nvm/versions/node/v22.16.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:517:4184)\n    at async xE5 (file:///Users/theo/.nvm/versions/node/v22.16.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:2342:5983)\n    at async yE5 (file:///Users/theo/.nvm/versions/node/v22.16.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:2338:19257)","timestamp":"2025-06-09T18:28:17.722Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.109: `tool_use` ids were found without `tool_result` blocks immediately after: toolu_01EkJ9RBB4DzBJ4Niii1atLP. Each `tool_use` block must have a corresponding `tool_result` block in the next message.\"}}\n    at Y5.generate (file:///Users/theo/.nvm/versions/node/v22.16.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1338:12578)\n    at Kw.makeStatusError (file:///Users/theo/.nvm/versions/node/v22.16.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1353:2082)\n    at Kw.makeRequest (file:///Users/theo/.nvm/versions/node/v22.16.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1353:5257)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async Qw2.ae.showErrors (file:///Users/theo/.nvm/versions/node/v22.16.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1680:20863)\n    at async ae (file:///Users/theo/.nvm/versions/node/v22.16.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1680:12252)\n    at async Qw2 (file:///Users/theo/.nvm/versions/node/v22.16.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1680:20726)\n    at async file:///Users/theo/.nvm/versions/node/v22.16.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1680:17149\n    at async vo1 (file:///Users/theo/.nvm/versions/node/v22.16.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1680:5204)\n    at async dd (file:///Users/theo/.nvm/versions/node/v22.16.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1680:17119)","timestamp":"2025-06-09T18:28:25.077Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.109: `tool_use` ids were found without `tool_result` blocks immediately after: toolu_01EkJ9RBB4DzBJ4Niii1atLP. Each `tool_use` block must have a corresponding `tool_result` block in the next message.\"}}\n    at Y5.generate (file:///Users/theo/.nvm/versions/node/v22.16.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1338:12578)\n    at Kw.makeStatusError (file:///Users/theo/.nvm/versions/node/v22.16.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1353:2082)\n    at Kw.makeRequest (file:///Users/theo/.nvm/versions/node/v22.16.0/lib/node_modules/@anthropic-ai/claude-code/cli.js:1

Note: Error logs were truncated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:apiarea:corebugSomething isn't workingduplicateThis issue or pull request already existsplatform:macosIssue specifically occurs on macOS

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions