Skip to content

Escape Key Breaks Tool Use Workflow: Missing Tool Result Blocks #1956

@akon2997

Description

@akon2997

Bug Description
When in tool use if you press escape, claude code gets reset and gives the following error there after
⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"messages.13: tool_use ids
were found without tool_result blocks immediately after: toolu_011PyFSzY1U9C7SNGknJM2cy,
toolu_013LBQu4TbyNPCiBNjp4uisF, toolu_01ALZUYNZ4pawWDUh2zAJxVh. Each tool_use block must have a
corresponding tool_result block in the next message."}}

Environment Info

  • Platform: linux
  • Terminal: vscode
  • Version: 1.0.18
  • Feedback ID: df1971ff-6675-4adc-8fb2-cd22cb160c75

Errors

[{"error":"ShellError: Shell command failed\n    at Object.call (file:///home/sidkvr/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:1578:1345)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async qD5 (file:///home/sidkvr/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:1901:19177)\n    at async LK1 (file:///home/sidkvr/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:1901:17763)\n    at async ND5 (file:///home/sidkvr/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:1901:16805)\n    at async ED5 (file:///home/sidkvr/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:1901:16434)\n    at async OO (file:///home/sidkvr/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:1901:15463)\n    at async OO (file:///home/sidkvr/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:1901:16289)\n    at async lZ (file:///home/sidkvr/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:2327:2123)","timestamp":"2025-06-11T15:09:01.100Z"},{"error":"Error: Request was aborted.\n    at Oo._createMessage (file:///home/sidkvr/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:1349:6810)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)","timestamp":"2025-06-11T15:09:09.477Z"},{"error":"Error: 400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.13: `tool_use` ids were found without `tool_result` blocks immediately after: toolu_011PyFSzY1U9C7SNGknJM2cy, toolu_013LBQu4TbyNPCiBNjp4uisF, toolu_01ALZUYNZ4pawWDUh2zAJxVh. Each `tool_use` block must have a corresponding `tool_result` block in the next message.\"}}\n    at g6.generate (file:///home/sidkvr/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:1343:12578)\n    at ww.makeStatusError (file:///home/sidkvr/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:1358:2082)\n    at ww.makeRequest (file:///home/sidkvr/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:1358:5257)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async Tw2.B11.showErrors (file:///home/sidkvr/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:1685:21041)\n    at async B11 (file:///home/sidkvr/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:1685:12154)\n    at async Tw2 (file:///home/sidkvr/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:1685:20887)\n    at async file:///home/sidkvr/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:1685:17052\n    at async to1 (file:///home/sidkvr/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:1685:5102)\n    at async nd (file:///home/sidkvr/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.js:1685:17022)","timestamp":"2025-06-11T15:09:15.787Z"}]

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:apiarea:corebugSomething isn't workingduplicateThis issue or pull request already existshas reproHas detailed reproduction stepsplatform:linuxIssue specifically occurs on Linux

    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