Skip to content

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

fix(session_host): render typed failure cause when stop reason is absent

Steven Enamakeladd7ae199f39
diff --git a/crates/openhuman-core/src/agent/session_host/driver/grounded_close_tests.rs b/crates/openhuman-core/src/agent/session_host/driver/grounded_close_tests.rs
index 2e3c26e0c2..23d0759328 100644
--- a/crates/openhuman-core/src/agent/session_host/driver/grounded_close_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/driver/grounded_close_tests.rs
@@ -187,7 +187,9 @@ fn typed_cause_without_halt_note_still_closes_and_keeps_operation() {
let close = classified_halt_close(&outcome).expect("typed cause closes without a note");
assert!(
- close.output.contains("configured model or provider rejected"),
+ close
+ .output
+ .contains("configured model or provider rejected"),
"summary uses typed provider_config cause even without a note: {}",
close.output
);
diff --git a/crates/openhuman-core/src/agent/session_host/turn_checkpoint.rs b/crates/openhuman-core/src/agent/session_host/turn_checkpoint.rs
index afa8d5fe04..a5da843079 100644
--- a/crates/openhuman-core/src/agent/session_host/turn_checkpoint.rs
+++ b/crates/openhuman-core/src/agent/session_host/turn_checkpoint.rs
@@ -519,11 +519,15 @@ pub(crate) fn build_deterministic_final_summary_with_cause(
stop_reason: Option<&str>,
failure_cause: Option<&tinyagents_harness::no_progress::ClassifiedStopCause>,
) -> String {
- if results.is_empty() && stop_reason.is_none() {
+ if results.is_empty() && stop_reason.is_none() && failure_cause.is_none() {
return "I finished this turn but produced no result to report.".to_string();
}
- if let Some(reason) = stop_reason {
- return super::stop_summary::render_stop_summary_with_cause(results, reason, failure_cause);
+ if stop_reason.is_some() || failure_cause.is_some() {
+ return super::stop_summary::render_stop_summary_with_cause(
+ results,
+ stop_reason.unwrap_or_default(),
+ failure_cause,
+ );
}
let mut out = String::from(
"I finished this turn without writing up a result. Here is what each tool call returned:\n",