Skip to content

feat: follow-up message interrupt (like vanilla Claude Code)#147

Open
Fr4nzz wants to merge 1 commit intoRichardAtCT:mainfrom
Fr4nzz:feat/follow-up-interrupt
Open

feat: follow-up message interrupt (like vanilla Claude Code)#147
Fr4nzz wants to merge 1 commit intoRichardAtCT:mainfrom
Fr4nzz:feat/follow-up-interrupt

Conversation

@Fr4nzz
Copy link

@Fr4nzz Fr4nzz commented Mar 15, 2026

Summary

  • When a user sends a follow-up message while Claude is processing, the bot interrupts the current task and immediately processes the follow-up in the same session
  • Uses the SDK's client.interrupt() control protocol (equivalent to Ctrl+C)
  • If graceful interrupt doesn't stop within 3 seconds, falls back to killing the subprocess
  • Session history is preserved across interrupts — Claude remembers everything
  • Adds /stop command for manually cancelling tasks
  • Enables concurrent_updates(True) so follow-up messages are handled in parallel

How it works

  1. User sends message A → Claude starts processing
  2. User sends message B while Claude is working
  3. Bot sends interrupt() signal to Claude (like Ctrl+C)
  4. Claude stops, session ID is preserved
  5. Bot immediately sends message B as a continuation of the same session
  6. Claude sees full conversation history + message B

Test plan

  • Send a long task, then send a follow-up while processing
  • Verify 📨 Interrupting... appears and the follow-up is processed
  • Verify /stop cancels a running task
  • Verify session continues after interrupt (Claude remembers context)
  • Verify normal sequential messages still work when no task is running

🤖 Generated with Claude Code

- Enable concurrent update processing for parallel message handling
- Send interrupt signal when follow-up message arrives during processing
- Graceful interrupt via SDK control protocol, falls back to subprocess kill
- Track running task across all handlers (text, photo, document, media)
- Add /stop command to manually cancel running tasks
- Session preserved across interrupts for seamless conversation flow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant