agent: Use correct subagent thread entity to get the entries list (#50515)

Ben Brandt created

Was grabbing off the Thread not the AcpThead :facepalm:

Release Notes:

- N/A

Change summary

crates/agent/src/agent.rs  | 2 +-
crates/agent/src/thread.rs | 4 ----
2 files changed, 1 insertion(+), 5 deletions(-)

Detailed changes

crates/agent/src/agent.rs 🔗

@@ -1749,7 +1749,7 @@ impl SubagentHandle for NativeSubagentHandle {
     }
 
     fn num_entries(&self, cx: &App) -> usize {
-        self.subagent_thread.read(cx).num_messages()
+        self.acp_thread.read(cx).entries().len()
     }
 
     fn send(&self, message: String, cx: &AsyncApp) -> Task<Result<String>> {

crates/agent/src/thread.rs 🔗

@@ -1389,10 +1389,6 @@ impl Thread {
         self.messages.last()
     }
 
-    pub fn num_messages(&self) -> usize {
-        self.messages.len()
-    }
-
     #[cfg(any(test, feature = "test-support"))]
     pub fn last_received_or_pending_message(&self) -> Option<Message> {
         if let Some(message) = self.pending_message.clone() {