[BUG] Race condition when pressing up arrow key
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 multiple messages are already queued to be presented to the model it is possible to hit the up arrow key to begin editing a message and have that same message be sent to the model while its also placed into the edit text box if you hit the up arrow key at the exact same time as it would be delivered to the model for processing.
What Should Happen?
Edit should fail because the message was already presented to the model.
Error Messages/Logs
Steps to Reproduce
write a message to the model, press enter.
write more messages to the model while it's thinking which become queued.
press up arrow key at exactly the same time as the model stops thinking.
the message is both sent to the model and placed in the edit box.
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.153 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
thanks
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗