From 969fb8fe03d6336338b25775ac874c1123b09a02 Mon Sep 17 00:00:00 2001 From: "Joseph T. Lyons" Date: Tue, 27 Jan 2026 03:14:37 -0500 Subject: [PATCH] Fix native agent thread history notify refresh (#47733) Release Notes: - N/A --- crates/agent/src/agent.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/crates/agent/src/agent.rs b/crates/agent/src/agent.rs index 9aa7657f628d3ef033f3ea93fc1dbf8fd5310e44..d8d2f4d3a74be2d9bd0f9c82add1301f1a0299a9 100644 --- a/crates/agent/src/agent.rs +++ b/crates/agent/src/agent.rs @@ -1399,6 +1399,7 @@ impl acp_thread::AgentTelemetry for NativeAgentConnection { pub struct NativeAgentSessionList { thread_store: Entity, + updates_tx: smol::channel::Sender, updates_rx: smol::channel::Receiver, _subscription: Subscription, } @@ -1406,11 +1407,15 @@ pub struct NativeAgentSessionList { impl NativeAgentSessionList { fn new(thread_store: Entity, cx: &mut App) -> Self { let (tx, rx) = smol::channel::unbounded(); + let this_tx = tx.clone(); let subscription = cx.observe(&thread_store, move |_, _| { - tx.try_send(acp_thread::SessionListUpdate::Refresh).ok(); + this_tx + .try_send(acp_thread::SessionListUpdate::Refresh) + .ok(); }); Self { thread_store, + updates_tx: tx, updates_rx: rx, _subscription: subscription, } @@ -1467,6 +1472,12 @@ impl AgentSessionList for NativeAgentSessionList { Some(self.updates_rx.clone()) } + fn notify_refresh(&self) { + self.updates_tx + .try_send(acp_thread::SessionListUpdate::Refresh) + .ok(); + } + fn into_any(self: Rc) -> Rc { self }