diff --git a/crates/agent/src/thread_history.rs b/crates/agent/src/thread_history.rs index ea7325dfab..267e2b1485 100644 --- a/crates/agent/src/thread_history.rs +++ b/crates/agent/src/thread_history.rs @@ -258,11 +258,7 @@ impl ThreadHistory { }; if let Some(task) = task_result.log_err() { - cx.spawn(async move |this, cx| { - task.await?; - this.update(cx, |this, cx| this.update_all_entries(cx)) - }) - .detach_and_log_err(cx); + task.detach_and_log_err(cx); }; cx.notify(); diff --git a/crates/agent/src/thread_store.rs b/crates/agent/src/thread_store.rs index 2a838d2866..8a0140810e 100644 --- a/crates/agent/src/thread_store.rs +++ b/crates/agent/src/thread_store.rs @@ -174,8 +174,9 @@ impl ThreadStore { let database = database_future.await.map_err(|err| anyhow!(err))?; database.delete_thread(id.clone()).await?; - this.update(cx, |this, _cx| { - this.threads.retain(|thread| thread.id != id) + this.update(cx, |this, cx| { + this.threads.retain(|thread| thread.id != id); + cx.notify(); }) }) }