Skip to content

Feature Request: Escape key to interrupt a running agent turn #3196

Description

@amazd

Summary

Currently, the only way to stop the harness mid-run is Ctrl+C, which kills the entire process.
Claude Code supports pressing Escape to gracefully interrupt an in-progress agent turn
without exiting the session.

Current behavior

  • input.rs binds Ctrl+C → ReadOutcome::Cancel / ReadOutcome::Exit
  • No KeyCode::Esc binding exists during an active turn
  • No in-flight request cancellation is wired up

Desired behavior

Press Escape while the agent is running to:

  1. Cancel the active API request
  2. Transition the worker state from Running → Interrupted
  3. Return control to the REPL prompt without exiting the session

Implementation sketch

  • Detect KeyCode::Esc in rusty-claude-cli/src/input.rs during an active turn
  • Add an Interrupted state to the worker lifecycle in runtime/
  • Cancel the in-flight HTTP request (e.g., via a CancellationToken)
  • Emit a cancellation event for observability

Activity

  1. 1716775457damn commented on May 31, 2026

    @1716775457damn

    Good feature request — Ctrl+C killing the entire process is rough when you just want to stop the current turn. The Escape -> Cancel -> Interrupted -> REPL flow mirrors Claude Code's behavior well. CancellationToken for in-flight requests makes sense.

  2. Yeachan-Heo commented on Jun 5, 2026

    @Yeachan-Heo
    Contributor

    Feature request for Escape key interrupt during agent turns. This requires REPL-level signal handling changes. Tracked in ROADMAP.md as an architectural gap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions