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)