From 6b0b95f539c1cac659cfa14e04be3816a48b68a9 Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Fri, 23 Jan 2026 12:31:43 -0500 Subject: [PATCH] Show red X icon for interrupted subagents (#47499) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Screenshot 2026-01-23 at 11 59 24 AM When a thread is interrupted while subagents are running, the subagent cards now show a red X icon instead of a green checkmark. This provides clearer visual feedback that the subagent was canceled rather than completed successfully. The icon logic now handles three states: - **Spinner**: when status is Pending or InProgress - **Red X**: when status is Canceled, Failed, or Rejected - **Green checkmark**: when status is Completed This matches the existing pattern used elsewhere in the codebase for showing error states on tool calls. (No release notes because subagents are still behind a feature flag.) Release Notes: - N/A --- crates/agent_ui/src/acp/thread_view.rs | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/crates/agent_ui/src/acp/thread_view.rs b/crates/agent_ui/src/acp/thread_view.rs index 01a63111f8780434ad3be29ce3bae16226d522fb..75bb3716d8abfd6f1399a7011e04f86f97060313 100644 --- a/crates/agent_ui/src/acp/thread_view.rs +++ b/crates/agent_ui/src/acp/thread_view.rs @@ -3688,10 +3688,7 @@ impl AcpThreadView { .filter_map(|c| c.subagent_thread().cloned()) .collect(); - let tool_call_in_progress = matches!( - tool_call.status, - ToolCallStatus::Pending | ToolCallStatus::InProgress - ); + let tool_call_status = &tool_call.status; v_flex() .mx_5() @@ -3706,7 +3703,7 @@ impl AcpThreadView { entry_ix, context_ix, &thread, - tool_call_in_progress, + tool_call_status, window, cx, ) @@ -3719,7 +3716,7 @@ impl AcpThreadView { entry_ix: usize, context_ix: usize, thread: &Entity, - tool_call_in_progress: bool, + tool_call_status: &ToolCallStatus, window: &Window, cx: &Context, ) -> AnyElement { @@ -3733,7 +3730,14 @@ impl AcpThreadView { let files_changed = changed_buffers.len(); let diff_stats = DiffStats::all_files(&changed_buffers, cx); - let is_running = tool_call_in_progress; + let is_running = matches!( + tool_call_status, + ToolCallStatus::Pending | ToolCallStatus::InProgress + ); + let is_canceled_or_failed = matches!( + tool_call_status, + ToolCallStatus::Canceled | ToolCallStatus::Failed | ToolCallStatus::Rejected + ); let card_header_id = SharedString::from(format!("subagent-header-{}-{}", entry_ix, context_ix)); @@ -3743,6 +3747,11 @@ impl AcpThreadView { SpinnerLabel::new() .size(LabelSize::Small) .into_any_element() + } else if is_canceled_or_failed { + Icon::new(IconName::Close) + .size(IconSize::Small) + .color(Color::Error) + .into_any_element() } else { Icon::new(IconName::Check) .size(IconSize::Small)