From 70da1763536cd852af3ca4a7ce43057e100fd55f Mon Sep 17 00:00:00 2001 From: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Date: Tue, 13 Jan 2026 08:43:45 -0300 Subject: [PATCH] agent_ui: Make stopping a running terminal cancel thread generation (#46663) This makes stopping a terminal tool call in the agent panel also cancel the thread generation: https://github.com/user-attachments/assets/702ba078-53a8-4816-80f3-b6215e764365 Release Notes: - Agent: Made the act of stopping a terminal tool call in the agent panel also cancel the thread generation. --- crates/agent_ui/src/acp/thread_view.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/agent_ui/src/acp/thread_view.rs b/crates/agent_ui/src/acp/thread_view.rs index f168f56d70c8a5c2e996cbc367747f77457adbd4..74a59cf43a89a30ffcab0f48dcc0edbd4eb08a30 100644 --- a/crates/agent_ui/src/acp/thread_view.rs +++ b/crates/agent_ui/src/acp/thread_view.rs @@ -3778,10 +3778,11 @@ impl AcpThreadView { }) .on_click({ let terminal = terminal.clone(); - cx.listener(move |_this, _event, _window, cx| { + cx.listener(move |this, _event, _window, cx| { terminal.update(cx, |terminal, cx| { terminal.stop_by_user(cx); }); + this.cancel_generation(cx); }) }), )