diff --git a/crates/rhema-claw/src/daemon.rs b/crates/rhema-claw/src/daemon.rs index 45ebb98..33ba1d5 100644 --- a/crates/rhema-claw/src/daemon.rs +++ b/crates/rhema-claw/src/daemon.rs @@ -182,12 +182,24 @@ fn spawn_pass(driver: Arc, label: &'static str, busy: Arc) { .iter() .filter(|outcome| matches!(outcome, Outcome::Handled)) .count(); - let failed = outcomes + let failures: Vec<&String> = outcomes .iter() - .filter(|outcome| matches!(outcome, Outcome::Failed(_))) - .count(); - if handled + failed > 0 { - eprintln!("[claw] {label} pass: {handled} handled, {failed} failed"); + .filter_map(|outcome| match outcome { + Outcome::Failed(reason) => Some(reason), + _ => None, + }) + .collect(); + if handled + failures.len() > 0 { + eprintln!( + "[claw] {label} pass: {handled} handled, {} failed", + failures.len() + ); + } + // The count alone says a run died and not why: a + // checkpoint refused by a dead lease reads the same as a + // provider hanging up. The reason is the only trace. + for reason in failures { + eprintln!("[claw] warning: a {label} run failed: {reason}"); } } Err(err) => eprintln!("[claw] warning: {label} pass failed: {err}"), @@ -751,7 +763,24 @@ impl Daemon { async fn drain_interactive(&self) { match self.interactive_driver.run_once().await { Ok(runs) if !runs.is_empty() => { - eprintln!("[claw] interactive: {} queued run(s) drained", runs.len()); + let failures: Vec<&String> = runs + .iter() + .filter_map(|outcome| match outcome { + Outcome::Failed(reason) => Some(reason), + _ => None, + }) + .collect(); + eprintln!( + "[claw] interactive: {} queued run(s) drained, {} failed", + runs.len(), + failures.len() + ); + // Same rule as the lanes: a failed run's only trace is + // the reason the handler gave, and a chat turn that + // died without one looks exactly like a slow model. + for reason in failures { + eprintln!("[claw] warning: an interactive run failed: {reason}"); + } } Ok(_) => {} Err(err) => eprintln!("[claw] warning: interactive pass failed: {err}"),