Skip to content

feat(wrap): add SIGINT support to execution backends#471

Open
geoffjay wants to merge 1 commit intomainfrom
issue-404
Open

feat(wrap): add SIGINT support to execution backends#471
geoffjay wants to merge 1 commit intomainfrom
issue-404

Conversation

@geoffjay
Copy link
Owner

Summary

  • Extends ExecutionBackend trait with a new required async fn send_interrupt(&self, session_id: &str) -> Result<()> method
  • TmuxBackend implements via tmux send-keys -t {session} C-c (sends Ctrl-C / SIGINT to the foreground process without killing the session)
  • DockerBackend implements via bollard's kill_container with SIGINT signal (docker kill --signal=SIGINT)
  • Both backends return clear errors for non-existent sessions/containers
  • Unit tests added for all three affected files covering error cases and trait object-safety

Test plan

  • cargo build -p wrap passes
  • cargo clippy -p wrap passes
  • cargo test -p wrap — all new tests pass
  • Non-existent tmux session returns a meaningful error
  • Non-existent Docker container returns a meaningful error

Closes #404

🤖 Generated with Claude Code

…tations

Extends the ExecutionBackend trait with send_interrupt(&str) -> Result<()>
so the orchestrator can deliver SIGINT to in-flight Claude Code prompts
without terminating the underlying session or container.

- ExecutionBackend trait: new required async fn send_interrupt(session_id)
- TmuxManager: send_interrupt via `tmux send-keys -t {session} C-c`
  with pre-flight session existence check for clear error messages
- TmuxBackend: delegates to TmuxManager via spawn_blocking
- DockerBackend: send_interrupt via bollard kill_container(SIGINT)
  with 404-aware error handling for missing containers
- Unit tests for all three: non-existent session/container returns Err,
  error messages are meaningful, and trait object-safety is preserved

Closes #404

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

Add SIGINT support to wrap crate execution backends

1 participant