pub struct AcpTestHarness {
pub client_cx: ConnectionTo<Agent>,
pub peer: TestPeer,
/* private fields */
}Expand description
In-memory ACP harness running the real acp_agent_builder against a
pre-wired test client. Created via AcpTestHarness::start inside a
LocalSet. The harness owns an [AcpState] and a temp-dir-backed
[SessionStore] so tests can register fake-driven sessions without
going through new_session.
Fields§
§client_cx: ConnectionTo<Agent>§peer: TestPeerImplementations§
Source§impl AcpTestHarness
impl AcpTestHarness
pub async fn start() -> Self
pub async fn insert_agent_switching_session(&self) -> FakeAgentSwitchingSession
pub async fn insert_agent_switching_session_with_serverless_coder( &self, ) -> FakeAgentSwitchingSession
pub async fn insert_loaded_agent_switching_session( &self, session_id: &str, ) -> FakeAgentSwitchingSession
pub async fn expect_mcp_server_status(&mut self, expected: &[&str])
pub async fn expect_mcp_server_status_exact(&mut self, expected: &[&str])
pub async fn expect_available_commands( &mut self, expected: &[&str], unexpected: &[&str], )
pub fn append_agent_switch( &self, session_id: &str, from: Option<&str>, to: Option<&str>, )
Sourcepub async fn insert_stub_session(
&self,
agent_tx: Sender<Command>,
agent_rx: Receiver<AgentMessage>,
agent_handle: AgentHandle,
id: SessionId,
model: &str,
)
pub async fn insert_stub_session( &self, agent_tx: Sender<Command>, agent_rx: Receiver<AgentMessage>, agent_handle: AgentHandle, id: SessionId, model: &str, )
Register a stub session built from a hand-spawned
(agent_tx, agent_rx, agent_handle) triple — typically from
aether_core::core::agent(fake_llm).spawn().await. Pairs the agent with a
real but empty in-memory MCP (no servers). The session is routable via
state.route_prompt(id) / state.cancel(id).
pub fn append_stored_session(&self, session_id: &str, created_at: &str)
pub fn append_stored_prompt(&self, session_id: &str, prompt: &str)
pub fn append_stored_user_blocks( &self, session_id: &str, blocks: Vec<ContentBlock>, )
pub fn append_stored_agent_text(&self, session_id: &str, text: &str)
Auto Trait Implementations§
impl Freeze for AcpTestHarness
impl !RefUnwindSafe for AcpTestHarness
impl Send for AcpTestHarness
impl Sync for AcpTestHarness
impl Unpin for AcpTestHarness
impl UnsafeUnpin for AcpTestHarness
impl !UnwindSafe for AcpTestHarness
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoMaybeUndefined<T> for T
impl<T> IntoMaybeUndefined<T> for T
fn into_maybe_undefined(self) -> MaybeUndefined<T>
Source§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
fn into_option(self) -> Option<T>
Creates a shared type from an unshared type.