INNER CODE UNIT · Rust

wait_for_stderr

xuzhougeng/wisp-science · crates/wisp-acp/src/lib.rs:471

async fn wait_for_stderr(stderr: &BoundedStderr) -> String {
    // ponytail: 500ms ceiling (50×10ms). Only the fully-elapsed, no-stderr case
    // waits the whole budget, and it's already an error path. Raise if a slower
    // agent ever needs longer to flush.
    for _ in 0..50 {
        let snapshot = stderr.snapshot();
        if !snapshot.is_empty() {
            return snapshot;
        }
        tokio::time::sleep(Duration::from_millis(10)).await;
    }
    stderr.snapshot()
}

impl Drop for AcpSessionHandle {
    fn drop(&mut self) {
        if let Some(actor) = self.actor.lock().expect("ACP actor mutex poisoned").take() {
            actor.abort();

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…