pub struct AcpTestHarness {
pub client_cx: ConnectionTo<Agent>,
pub peer: TestPeer,
pub initialize_response: InitializeResponse,
pub auth_updates: UnboundedReceiver<AuthMethodsUpdatedParams>,
pub oauth_store: Arc<FakeOAuthCredentialStore>,
/* private fields */
}Fields§
§client_cx: ConnectionTo<Agent>§peer: TestPeer§initialize_response: InitializeResponse§auth_updates: UnboundedReceiver<AuthMethodsUpdatedParams>§oauth_store: Arc<FakeOAuthCredentialStore>Implementations§
Source§impl AcpTestHarness
impl AcpTestHarness
pub fn pause_next_runtime(&self) -> PendingRuntime
pub fn pause_prompt_expansion(&self) -> (Arc<Notify>, Arc<Notify>)
pub fn watch_agent_prompts(&self) -> Receiver<usize>
pub fn elicit_during_prompt_expansion(&self) -> UnboundedReceiver<ElicitResult>
pub fn live_runtime_count(&self) -> usize
pub async fn disconnect(&mut self)
pub async fn start_unattached_session( &mut self, prompt: impl Into<String>, ) -> SessionId
Sourcepub async fn reconnect(&mut self)
pub async fn reconnect(&mut self)
Connect a fresh initialized client to the same host and session store.
pub async fn resume(&self, session_id: &SessionId)
pub async fn resume_with_replay(&self, session_id: &SessionId)
Sourcepub async fn serve_websocket(&mut self) -> AcpWebSocketTestServer
pub async fn serve_websocket(&mut self) -> AcpWebSocketTestServer
Move this persistent host from its in-memory connection to a real port-zero listener.
Sourcepub async fn listen_websocket(&self) -> AcpWebSocketTestServer
pub async fn listen_websocket(&self) -> AcpWebSocketTestServer
Listen without disconnecting any existing client.
pub fn stored_events(&self, session_id: &SessionId) -> Vec<SessionEvent>
Sourcepub async fn run<F, Fut, T>(body: F) -> T
pub async fn run<F, Fut, T>(body: F) -> T
Runs body with a fresh harness on the current-thread LocalSet the
host needs for its spawn_local tasks; tests must be annotated with
#[tokio::test(flavor = "current_thread")].
pub async fn run_with_hooks<F, Fut>(hooks: SessionHooks, body: F)
pub async fn start() -> Self
pub fn resume_agent(&self) -> &FakeAcpAgent
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_idle( &mut self, session_id: &SessionId, expected: StopReason, )
pub async fn updates_until( &mut self, session_id: &SessionId, last: impl Fn(&SessionUpdate) -> bool, ) -> Vec<SessionUpdate>
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<AgentEvent>,
agent_handle: AgentHandle,
id: SessionId,
model: &str,
)
pub async fn insert_stub_session( &self, agent_tx: Sender<Command>, agent_rx: Receiver<AgentEvent>, 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 async fn insert_background_task_session( &self, provider: FakeLlmProvider, task: &FakeBackgroundTask, id: SessionId, )
pub fn append_stored_session(&self, session_id: &str, created_at: &str)
pub fn append_stored_session_in( &self, session_id: &str, created_at: &str, cwd: &Path, )
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_turn(&self, session_id: &str, text: &str)
pub fn append_stored_agent_text(&self, session_id: &str, text: &str)
pub fn append_stored_tool_call( &self, session_id: &str, id: &str, name: &str, arguments: &str, )
pub fn append_stored_tool_result( &self, session_id: &str, id: &str, name: &str, result: &str, )
pub fn append_stored_event(&self, session_id: &str, event: &SessionEvent)
Auto Trait Implementations§
impl !RefUnwindSafe for AcpTestHarness
impl !UnwindSafe for AcpTestHarness
impl Freeze for AcpTestHarness
impl Send for AcpTestHarness
impl Sync for AcpTestHarness
impl Unpin for AcpTestHarness
impl UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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
Source§fn into_maybe_undefined(self) -> MaybeUndefined<T>
fn into_maybe_undefined(self) -> MaybeUndefined<T>
Converts this value into a three-state builder argument.
Source§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
Source§fn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Converts this value into an optional builder argument.
Creates a shared type from an unshared type.