fix(daemon): say why a run failed, not only how many did
android / debug (push) Successful in 2m15s
android / release (push) Successful in 2m5s
ci / checks (push) Successful in 2m47s
ci / test (push) Successful in 1m7s
ci / chart (push) Successful in 6s
ci / docker (push) Successful in 1m51s
ci / web (push) Successful in 13s
ci / publish-edge-images (deploy/docker/claw.Dockerfile, rhema-claw) (push) Successful in 2m1s
ci / publish-edge-images (deploy/docker/ui.Dockerfile, rhema-claw-ui) (push) Successful in 15s
ci / publish-edge-chart (push) Successful in 4s

A lane pass logged "N handled, M failed" and the interactive drain logged
how many runs it emptied, both without the reason. A run that dies is
the one thing an operator has to see, and its only trace is the reason
the driver recorded: a checkpoint refused by a dead lease, a provider
hanging up, a panicking handler. The count alone reads as noise next to
the tick logs, and a chat turn that failed without a line looks exactly
like a slow model.

Both paths print the reason now. `Outcome` carries no key, so the
warning names the lane and quotes what the run said — a handler's own
failure names its key.
This commit is contained in:
vhaudiquet committed 2026-12-02 18:37:31 +01:00
1 parent 88c220634d
commit 8d72907b05
1 file changed
+35 -6
+35 -6
View File
@@ -182,12 +182,24 @@ fn spawn_pass(driver: Arc<Driver>, label: &'static str, busy: Arc<AtomicBool>) {
.iter() .iter()
.filter(|outcome| matches!(outcome, Outcome::Handled)) .filter(|outcome| matches!(outcome, Outcome::Handled))
.count(); .count();
let failed = outcomes let failures: Vec<&String> = outcomes
.iter() .iter()
.filter(|outcome| matches!(outcome, Outcome::Failed(_))) .filter_map(|outcome| match outcome {
.count(); Outcome::Failed(reason) => Some(reason),
if handled + failed > 0 { _ => None,
eprintln!("[claw] {label} pass: {handled} handled, {failed} failed"); })
.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}"), Err(err) => eprintln!("[claw] warning: {label} pass failed: {err}"),
@@ -751,7 +763,24 @@ impl Daemon {
async fn drain_interactive(&self) { async fn drain_interactive(&self) {
match self.interactive_driver.run_once().await { match self.interactive_driver.run_once().await {
Ok(runs) if !runs.is_empty() => { 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(_) => {} Ok(_) => {}
Err(err) => eprintln!("[claw] warning: interactive pass failed: {err}"), Err(err) => eprintln!("[claw] warning: interactive pass failed: {err}"),