Skip to content

Conversation

@evalstate
Copy link
Owner

Wire ESC key handling to cancel ongoing LLM requests during streaming. Creates a keyboard listener that runs concurrently with the streaming task and cancels it when ESC is pressed. Uses the existing asyncio Task.cancel() mechanism that LLM providers already handle.

claude and others added 3 commits November 23, 2025 16:06
Wire ESC key handling to cancel ongoing LLM requests during streaming.
Creates a keyboard listener that runs concurrently with the streaming
task and cancels it when ESC is pressed. Uses the existing asyncio
Task.cancel() mechanism that LLM providers already handle.
- Rewrite keyboard listener to use thread-based approach that works
  with Rich's Live display (cbreak mode instead of raw mode)
- Add CANCELLED case to LlmStopReason handler in llm_agent.py to
  display friendly message instead of "unhandled reason" error
- Progress display cleanup is already handled via _shutdown_live_resources
@evalstate evalstate merged commit 8a10c4c into main Nov 23, 2025
6 checks passed
@evalstate evalstate deleted the claude/add-esc-cancel-streaming-017GkMkDzRXMttwY9qnXsLE1 branch November 27, 2025 21:52
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.

3 participants