pub struct Harness { /* private fields */ }async-client only.Expand description
A running localharness process that has completed its stdio handshake.
Dropping this kills the process.
Implementations§
Source§impl Harness
impl Harness
Sourcepub async fn launch(options: &HarnessOptions) -> Result<Self>
pub async fn launch(options: &HarnessOptions) -> Result<Self>
Spawns the binary and performs the length-prefixed stdio handshake.
Sourcepub fn stderr_tail(&self) -> String
pub fn stderr_tail(&self) -> String
The most recent harness stderr, which is where it reports model and configuration failures that never reach the wire.
This is a snapshot: output still in flight is not waited for. Use
Self::stderr_after_exit when diagnosing a failure.
Sourcepub async fn stderr_after_exit(&self) -> String
pub async fn stderr_after_exit(&self) -> String
The harness’s stderr, waited for.
A harness that hits a fatal error writes the reason to stderr and then exits, which breaks the socket. The client notices the broken socket first — so reading stderr at that instant is a race, and losing it turns a precise “API key not valid” into a bare “connection closed”. This waits (briefly, and only on failure paths) for the pipe to reach EOF, which happens exactly when the process is gone and its output is all in.