Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(tinyagents): recover halt summary mutex from poisoning

Steven Enamakelfb795cfd0a91
diff --git a/crates/openhuman-core/src/agent/tinyagents/stop_hooks.rs b/crates/openhuman-core/src/agent/tinyagents/stop_hooks.rs
index 1c8eb25d23..f2d050d4ef 100644
--- a/crates/openhuman-core/src/agent/tinyagents/stop_hooks.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/stop_hooks.rs
@@ -43,7 +43,9 @@ fn record_halt_summary(
halt_summary: &super::HaltSummarySlot,
report: &tinyagents_harness::middleware::library::StopReport,
) {
- *halt_summary.lock().expect("stop-hook halt mutex poisoned") = Some(format!(
+ *halt_summary
+ .lock()
+ .unwrap_or_else(std::sync::PoisonError::into_inner) = Some(format!(
"Stopping after {} model call(s): {}",
report.iteration, report.reason
));