diff --git a/crates/acp_thread/src/acp_thread.rs b/crates/acp_thread/src/acp_thread.rs index 0c7fb32357ec0815fd5537174a5964ed048ba973..b981370fe6349b275490fe015d455d855310bbc5 100644 --- a/crates/acp_thread/src/acp_thread.rs +++ b/crates/acp_thread/src/acp_thread.rs @@ -529,7 +529,6 @@ pub struct AcpThread { shared_buffers: HashMap, BufferSnapshot>, send_task: Option>, connection: Rc, - child_status: Option>>, session_id: acp::SessionId, } @@ -575,8 +574,6 @@ impl AcpThread { connection: Rc, // todo! remove me title: SharedString, - // todo! remove this? - child_status: Option>>, project: Entity, session_id: acp::SessionId, cx: &mut Context, @@ -592,7 +589,6 @@ impl AcpThread { project, send_task: None, connection, - child_status, session_id, } } @@ -1121,10 +1117,6 @@ impl AcpThread { }) } - pub fn child_status(&mut self) -> Option>> { - self.child_status.take() - } - pub fn to_markdown(&self, cx: &App) -> String { self.entries.iter().map(|e| e.to_markdown(cx)).collect() } @@ -1793,13 +1785,11 @@ mod tests { let connection = OldAcpAgentConnection { connection, child_status: io_task, - thread: thread_rc, }; AcpThread::new( Rc::new(connection), "Test".into(), - None, project, acp::SessionId("test".into()), cx, diff --git a/crates/acp_thread/src/connection.rs b/crates/acp_thread/src/connection.rs index 5106686714b21e9c0f0aa75082ef0ae52fd9e556..331bfab6e9ba589c1d2ac002a5097545fc2565af 100644 --- a/crates/acp_thread/src/connection.rs +++ b/crates/acp_thread/src/connection.rs @@ -1,9 +1,9 @@ -use std::{cell::RefCell, error::Error, fmt, path::Path, rc::Rc}; +use std::{error::Error, fmt, path::Path, rc::Rc}; use agent_client_protocol as acp; use agentic_coding_protocol::{self as acp_old, AgentRequest}; use anyhow::Result; -use gpui::{AppContext, AsyncApp, Entity, Task, WeakEntity}; +use gpui::{AppContext, AsyncApp, Entity, Task}; use project::Project; use ui::App; @@ -38,7 +38,6 @@ impl fmt::Display for Unauthenticated { pub struct OldAcpAgentConnection { pub connection: acp_old::AgentConnection, pub child_status: Task>, - pub thread: Rc>>, } impl AgentConnection for OldAcpAgentConnection { @@ -55,7 +54,6 @@ impl AgentConnection for OldAcpAgentConnection { } .into_any(), ); - let current_thread = self.thread.clone(); cx.spawn(async move |cx| { let result = task.await?; let result = acp_old::InitializeParams::response_from_any(result)?; @@ -67,9 +65,8 @@ impl AgentConnection for OldAcpAgentConnection { cx.update(|cx| { let thread = cx.new(|cx| { let session_id = acp::SessionId("acp-old-no-id".into()); - AcpThread::new(connection, "Gemini".into(), None, project, session_id, cx) + AcpThread::new(connection, "Gemini".into(), project, session_id, cx) }); - current_thread.replace(thread.downgrade()); thread }) }) diff --git a/crates/agent_servers/src/claude.rs b/crates/agent_servers/src/claude.rs index 7221b9f2a2c4082272356b3ddec0c479778d11f1..dedb337b4e45e2dbf30f4acba48fe5feac2eb4ab 100644 --- a/crates/agent_servers/src/claude.rs +++ b/crates/agent_servers/src/claude.rs @@ -205,16 +205,8 @@ impl AgentConnection for ClaudeAgentConnection { cx: &mut AsyncApp, ) -> Task>> { let session_id = self.session_id.clone(); - let thread_result = cx.new(|cx| { - AcpThread::new( - connection, - "Claude".into(), - None, - project, - session_id.clone(), - cx, - ) - }); + let thread_result = cx + .new(|cx| AcpThread::new(connection, "Claude".into(), project, session_id.clone(), cx)); if let Ok(thread) = &thread_result { self.threads_map diff --git a/crates/agent_servers/src/stdio_agent_server.rs b/crates/agent_servers/src/stdio_agent_server.rs index c2f5503591a4210b5aa5b2b1c9755180e6ae3f43..c3cb5ef1a67e301da570a615761248cba98be744 100644 --- a/crates/agent_servers/src/stdio_agent_server.rs +++ b/crates/agent_servers/src/stdio_agent_server.rs @@ -110,7 +110,6 @@ impl AgentServer for T { let connection: Rc = Rc::new(OldAcpAgentConnection { connection, child_status, - thread: thread_rc, }); Ok(connection)