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.

acp_thread: Fix compaction button stuck at loading state on error (#59161)

Danilo Leald8eb569cc5a8
diff --git a/crates/acp_thread/src/acp_thread.rs b/crates/acp_thread/src/acp_thread.rs
index 963e41cad0c..29734033974 100644
--- a/crates/acp_thread/src/acp_thread.rs
+++ b/crates/acp_thread/src/acp_thread.rs
@@ -2831,6 +2831,9 @@ impl AcpThread {
} else {
log::error!("Max tokens reached. Usage: {:?}", this.token_usage);
}
+ if is_same_turn {
+ this.mark_pending_entries_as_canceled(cx);
+ }
return Err(anyhow!(MaxOutputTokensError));
}
@@ -2893,7 +2896,9 @@ impl AcpThread {
}
Err(e) => {
Self::flush_streaming_text(&mut this.streaming_text_buffer, cx);
-
+ if is_same_turn {
+ this.mark_pending_entries_as_canceled(cx);
+ }
this.had_error = true;
cx.emit(AcpThreadEvent::Error);
log::error!("Error in run turn: {:?}", e);