Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions crates/acp_thread/src/acp_thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1760,6 +1760,7 @@ impl From<&AcpThread> for ActionLogTelemetry {

#[derive(Debug)]
pub enum AcpThreadEvent {
StatusChanged,
PromptUpdated,
NewEntry,
TitleUpdated,
Expand Down Expand Up @@ -3119,6 +3120,7 @@ impl AcpThread {
tx.send(f(this, cx).await).ok();
}),
});
cx.emit(AcpThreadEvent::StatusChanged);

cx.spawn(async move |this, cx| {
let response = rx.await;
Expand All @@ -3144,6 +3146,7 @@ impl AcpThread {
// state even when the send_task is cancelled before tx.send().
if is_same_turn {
this.running_turn.take();
cx.emit(AcpThreadEvent::StatusChanged);
}

let Ok(response) = response else {
Expand Down Expand Up @@ -3261,6 +3264,7 @@ impl AcpThread {

Self::flush_streaming_text(&mut self.streaming_text_buffer, cx);
self.mark_pending_entries_as_canceled(cx);
cx.emit(AcpThreadEvent::StatusChanged);

// Wait for the send task to complete
cx.background_spawn(turn.send_task)
Expand Down
1 change: 1 addition & 0 deletions crates/agent_ui/src/agent_diff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1431,6 +1431,7 @@ impl AgentDiff {
self.update_reviewing_editors(workspace, window, cx);
}
AcpThreadEvent::TitleUpdated
| AcpThreadEvent::StatusChanged
| AcpThreadEvent::TokenUsageUpdated
| AcpThreadEvent::SubagentSpawned(_)
| AcpThreadEvent::EntriesRemoved(_)
Expand Down
9 changes: 9 additions & 0 deletions crates/agent_ui/src/conversation_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ impl Conversation {
}
}
AcpThreadEvent::NewEntry
| AcpThreadEvent::StatusChanged
| AcpThreadEvent::TitleUpdated
| AcpThreadEvent::TokenUsageUpdated
| AcpThreadEvent::EntryUpdated(_)
Expand Down Expand Up @@ -521,6 +522,7 @@ fn affects_thread_metadata(event: &AcpThreadEvent) -> bool {
| AcpThreadEvent::WorkingDirectoriesUpdated => true,
// --
AcpThreadEvent::EntryUpdated(_)
| AcpThreadEvent::StatusChanged
| AcpThreadEvent::EntriesRemoved(_)
| AcpThreadEvent::Retry(_)
| AcpThreadEvent::TokenUsageUpdated
Expand Down Expand Up @@ -1486,6 +1488,13 @@ impl ConversationView {
cx.emit(RootThreadUpdated);
}
match event {
AcpThreadEvent::StatusChanged => {
if let Some(active) = self.thread_view(&session_id) {
active.update(cx, |active, cx| {
active.sync_generating_indicator(cx);
});
}
}
AcpThreadEvent::NewEntry => {
let len = thread.read(cx).entries().len();
let index = len - 1;
Expand Down
Loading