[BUG] interrupting Claude during tool use breaks entire conversation
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
when pressing escape during a tool call to interrupt claude, I can no longer send a new message. I now get:
API Error: 400
{"type":"error","error":{"type":"invalid_request_error","message":"messages.136.content.1:
unexpected tool_use_id found in tool_result blocks: toolu_01W9d1uqVn9j1wYVqgvDTp8i. Each
tool_result block must have a corresponding tool_use block in the previous
message."},"request_id":"req_011CVPhdQdinNfvDmx7pKgXL"}
What Should Happen?
I should be able to interrupt claude at any point ant send in a new chat and continue the conversation
Error Messages/Logs
API Error: 400
{"type":"error","error":{"type":"invalid_request_error","message":"messages.136.content.1:
unexpected `tool_use_id` found in `tool_result` blocks: toolu_01W9d1uqVn9j1wYVqgvDTp8i. Each
`tool_result` block must have a corresponding `tool_use` block in the previous
message."},"request_id":"req_011CVPhdQdinNfvDmx7pKgXL"}
Steps to Reproduce
- have Claude do work.
- during a tool call pres the esc key to interrupt
- try to send a new message
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.0.45
Claude Code Version
2.0.50
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Cursor
Additional Information
This was previously just working please revert whatever caused this. The only way to not have this error is to let Claude finish all of its work and interrupting it is one of the most necessary features to prevent it from doing thins that it should not do
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗