Skip to content

Cancel LRC conversations after Stop takeover#12623

Open
vkodithala wants to merge 1 commit into
masterfrom
varoon/bug-lrc-stop-cancel
Open

Cancel LRC conversations after Stop takeover#12623
vkodithala wants to merge 1 commit into
masterfrom
varoon/bug-lrc-stop-cancel

Conversation

@vkodithala

@vkodithala vkodithala commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes the LRC Stop cancellation path that can leave an Agent Mode conversation marked InProgress after the user stops a monitored long-running command.

This PR:

  • treats Ctrl-C in a Stop/user-control LRC state as conversation cancellation.
  • still writes Ctrl-C to the PTY so the underlying command is interrupted.
  • preserves transfer/manual user-control behavior by sending Ctrl-C to the PTY without cancelling the conversation.
  • adds focused regression coverage for Stop takeover vs. transfer takeover.

This is the first PR in a two-PR stack. The follow-up PR handles the agent-requested command focus / early Ctrl-C race.

For context, this was reported by ZL here and is a pretty trivial repro (tell an agent to run a long-running command, ctrl-c, ctrl-cin sequence to cancel the subagent and then the command, notice that a "Warping..." is still visible.

Linked Issue

N/A

  • The linked issue is labeled ready-to-spec or ready-to-implement.
  • Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes).

Testing

Demo of how this works end-to-end, along with a short explainer: https://www.loom.com/share/4654d825c946467ebaf92d800b7e8926.

  • ./script/format
  • git --no-pager diff --check
  • cargo nextest run -E 'test(ctrl_c_after_stop_takeover_cancels_conversation) | test(ctrl_c_after_transfer_takeover_does_not_cancel_conversation)'
  • cargo clippy --workspace --all-targets --all-features --tests -- -D warnings — not rerun after splitting; earlier attempt in this checkout was blocked in app/build.rs while downloading Sentry.xcframework because gh returned Bad credentials (HTTP 401).
  • I have manually tested my changes locally with ./script/run

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

CHANGELOG-BUG-FIX: Fixed an issue where pressing Ctrl-C to stop a command monitored by Warp Agent could leave the conversation stuck showing “Warping…”.

Co-Authored-By: Oz oz-agent@warp.dev

Copy link
Copy Markdown
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Comment thread app/src/terminal/view.rs
@vkodithala vkodithala marked this pull request as ready for review June 14, 2026 21:48
@vkodithala vkodithala requested a review from MaggieShan June 14, 2026 21:48
@oz-for-oss

oz-for-oss Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

@vkodithala

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Co-Authored-By: Oz <oz-agent@warp.dev>

@oz-for-oss oz-for-oss Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Overview

This PR updates Ctrl-C handling for agent-monitored long-running commands so a second Ctrl-C after a Stop takeover cancels the associated local Agent Mode conversation while still interrupting the PTY, and it adds regression coverage for Stop vs. transfer takeover behavior.

Concerns

  • No blocking correctness, security, or spec-alignment concerns found in the annotated diff. The PR description includes Loom visual evidence for the user-facing behavior.

Verdict

Found: 0 critical, 0 important, 0 suggestions

Approve

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@vkodithala vkodithala force-pushed the varoon/bug-lrc-stop-cancel branch from 825b47a to 0d69a7f Compare June 14, 2026 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant