Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

agent: Fix thinking step showing up as pending when completion is cancelled (#28019)

Bennet Bo Fennerc98bcc72b882
diff --git a/crates/agent/src/active_thread.rs b/crates/agent/src/active_thread.rs
index b9d820d3ac4..7920b245017 100644
--- a/crates/agent/src/active_thread.rs
+++ b/crates/agent/src/active_thread.rs
@@ -1449,7 +1449,8 @@ impl ActiveThread {
cx: &Context<Self>,
) -> impl IntoElement {
let is_last_message = self.messages.last() == Some(&message_id);
- let pending_thinking_segment_index = if is_last_message && !has_tool_uses {
+ let is_generating = self.thread.read(cx).is_generating();
+ let pending_thinking_segment_index = if is_generating && is_last_message && !has_tool_uses {
rendered_message
.segments
.iter()