From 8acb58b6e50fa26128675a9b8f60ee82a28c90dd Mon Sep 17 00:00:00 2001 From: Agus Zubiaga Date: Fri, 1 Aug 2025 18:15:26 -0300 Subject: [PATCH] Fix types --- crates/agent_servers/src/acp_connection.rs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/crates/agent_servers/src/acp_connection.rs b/crates/agent_servers/src/acp_connection.rs index ca9ec2aea0bb966087ca07182015ea26a1c381bf..0ced22fc65350b6d704c94db7e518a17ee10eb13 100644 --- a/crates/agent_servers/src/acp_connection.rs +++ b/crates/agent_servers/src/acp_connection.rs @@ -1,11 +1,10 @@ -use agent_client_protocol as acp; +use agent_client_protocol::{self as acp, Agent as _}; use collections::HashMap; use futures::channel::oneshot; use project::Project; use std::cell::RefCell; use std::path::Path; use std::rc::Rc; -use util::ResultExt; use anyhow::{Context as _, Result}; use gpui::{App, AppContext as _, AsyncApp, Entity, Task, WeakEntity}; @@ -15,7 +14,7 @@ use acp_thread::{AcpThread, AgentConnection, AuthRequired}; pub struct AcpConnection { server_name: &'static str, - connection: Rc, + connection: Rc, sessions: Rc>>, auth_methods: Vec, _io_task: Task>, @@ -51,7 +50,7 @@ impl AcpConnection { sessions: sessions.clone(), cx: cx.clone(), }; - let (connection, io_task) = acp::AgentConnection::new(client, stdin, stdout, { + let (connection, io_task) = acp::ClientSideConnection::new(client, stdin, stdout, { let foreground_executor = cx.foreground_executor().clone(); move |fut| { foreground_executor.spawn(fut).detach(); @@ -149,8 +148,14 @@ impl AgentConnection for AcpConnection { .spawn(async move { Ok(conn.prompt(params).await?) }) } - fn cancel(&self, session_id: &acp::SessionId, _cx: &mut App) { - self.connection.cancel(session_id.clone()).log_err(); + fn cancel(&self, session_id: &acp::SessionId, cx: &mut App) { + let conn = self.connection.clone(); + let params = acp::CancelledNotification { + session_id: session_id.clone(), + }; + cx.foreground_executor() + .spawn(async move { conn.cancelled(params).await }) + .detach(); } }