Skip to content

feat(agent): cancel active turns with Escape - #45

Merged
kacigaya merged 1 commit into
mainfrom
feat/turn-cancellation
Nov 5, 2026
Merged

kacigaya merged 1 commit into
mainfrom
feat/turn-cancellation

Conversation

@kacigaya

@kacigaya kacigaya commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

An active turn could only be stopped by quitting the app. Escape now stops the turn and keeps the TUI open for a follow-up request.

Cancellation closes the provider stream, dismisses pending approval, and terminates and reaps shell command process groups. The UI stays busy until cleanup finishes. Ctrl+C uses the same cleanup before exiting.

File changes already in progress finish before cancellation completes. Completed changes remain in place. History retains partial assistant text, completed results, and matching cancellation results for unstarted calls. An incomplete model tool request cannot execute.

Update the status hints, /help, README, and command documentation. Existing model-selector Escape behavior and N/Enter tool denial remain available. No dependencies were added.

Validation:

  • cargo fmt -- --check
  • cargo clippy --all-targets --locked -- -D warnings
  • cargo test --locked: 191 tests passed
  • cargo build --release --locked
  • cargo audit: no vulnerability findings; existing maintenance and yanked-package warnings remain
  • Python compilation and 10 bundled security-script tests
  • Website audit, lint, type check, two tests, and production build with Bun 1.4.4
  • Live TUI test through cargo run against a local mock Ollama server: Escape during streaming, approval, and a running shell command; HTTP stream closure; child termination; follow-up input; and Ctrl+C cleanup during another shell command

Cloud provider calls and macOS/Windows behavior were not tested locally. Provider stream cancellation is covered with native and JSON fallback test providers. In-progress file mutations deliberately finish instead of being dropped mid-write.

Copilot AI balanced review requested due to automatic review settings November 5, 2026 15:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@kacigaya kacigaya added the bug Something isn't working label Nov 5, 2026
@kacigaya
kacigaya merged commit da00138 into main Nov 5, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants