Cleanup unused fields

Ben Brandt created

Change summary

crates/acp_thread/src/acp_thread.rs            | 10 ----------
crates/acp_thread/src/connection.rs            |  9 +++------
crates/agent_servers/src/claude.rs             | 12 ++----------
crates/agent_servers/src/stdio_agent_server.rs |  1 -
4 files changed, 5 insertions(+), 27 deletions(-)

Detailed changes

crates/acp_thread/src/acp_thread.rs 🔗

@@ -529,7 +529,6 @@ pub struct AcpThread {
     shared_buffers: HashMap<Entity<Buffer>, BufferSnapshot>,
     send_task: Option<Task<()>>,
     connection: Rc<dyn AgentConnection>,
-    child_status: Option<Task<Result<()>>>,
     session_id: acp::SessionId,
 }
 
@@ -575,8 +574,6 @@ impl AcpThread {
         connection: Rc<dyn AgentConnection>,
         // todo! remove me
         title: SharedString,
-        // todo! remove this?
-        child_status: Option<Task<Result<()>>>,
         project: Entity<Project>,
         session_id: acp::SessionId,
         cx: &mut Context<Self>,
@@ -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<Task<Result<()>>> {
-        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,

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<Result<()>>,
-    pub thread: Rc<RefCell<WeakEntity<AcpThread>>>,
 }
 
 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
             })
         })

crates/agent_servers/src/claude.rs 🔗

@@ -205,16 +205,8 @@ impl AgentConnection for ClaudeAgentConnection {
         cx: &mut AsyncApp,
     ) -> Task<Result<Entity<AcpThread>>> {
         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

crates/agent_servers/src/stdio_agent_server.rs 🔗

@@ -110,7 +110,6 @@ impl<T: StdioAgentServer + 'static> AgentServer for T {
             let connection: Rc<dyn AgentConnection> = Rc::new(OldAcpAgentConnection {
                 connection,
                 child_status,
-                thread: thread_rc,
             });
 
             Ok(connection)