Fix remaining agent server integration tests (#35222)
Release Notes: - N/A
This commit is contained in:
parent
8f952f1b58
commit
9353ba7887
5 changed files with 33 additions and 20 deletions
|
@ -1597,6 +1597,7 @@ mod tests {
|
|||
name: "test",
|
||||
connection,
|
||||
child_status: io_task,
|
||||
current_thread: thread_rc,
|
||||
};
|
||||
|
||||
AcpThread::new(
|
||||
|
|
|
@ -7,6 +7,7 @@ use gpui::{AppContext as _, AsyncApp, Entity, Task, WeakEntity};
|
|||
use project::Project;
|
||||
use std::{cell::RefCell, error::Error, fmt, path::Path, rc::Rc};
|
||||
use ui::App;
|
||||
use util::ResultExt as _;
|
||||
|
||||
use crate::{AcpThread, AgentConnection};
|
||||
|
||||
|
@ -46,7 +47,7 @@ impl acp_old::Client for OldAcpClientDelegate {
|
|||
thread.push_assistant_content_block(thought.into(), true, cx)
|
||||
}
|
||||
})
|
||||
.ok();
|
||||
.log_err();
|
||||
})?;
|
||||
|
||||
Ok(())
|
||||
|
@ -364,6 +365,7 @@ pub struct OldAcpAgentConnection {
|
|||
pub name: &'static str,
|
||||
pub connection: acp_old::AgentConnection,
|
||||
pub child_status: Task<Result<()>>,
|
||||
pub current_thread: Rc<RefCell<WeakEntity<AcpThread>>>,
|
||||
}
|
||||
|
||||
impl AgentConnection for OldAcpAgentConnection {
|
||||
|
@ -383,6 +385,7 @@ impl AgentConnection for OldAcpAgentConnection {
|
|||
}
|
||||
.into_any(),
|
||||
);
|
||||
let current_thread = self.current_thread.clone();
|
||||
cx.spawn(async move |cx| {
|
||||
let result = task.await?;
|
||||
let result = acp_old::InitializeParams::response_from_any(result)?;
|
||||
|
@ -396,6 +399,7 @@ impl AgentConnection for OldAcpAgentConnection {
|
|||
let session_id = acp::SessionId("acp-old-no-id".into());
|
||||
AcpThread::new(self.clone(), project, session_id, cx)
|
||||
});
|
||||
current_thread.replace(thread.downgrade());
|
||||
thread
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue