Skip to content

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

test(agent): add stop summary and direct mode routing coverage

Steven Enamakel3e0c43f9fb8a
diff --git a/crates/openhuman-core/src/agent/session_host/stop_summary_tests.rs b/crates/openhuman-core/src/agent/session_host/stop_summary_tests.rs
index f30fb6cebd..386b985a3d 100644
--- a/crates/openhuman-core/src/agent/session_host/stop_summary_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/stop_summary_tests.rs
@@ -178,3 +178,17 @@ fn stop_notes_map_to_their_reason() {
assert_eq!(StopReasonKind::from_stop_note(note), expected, "{note}");
}
}
+
+/// When more distinct results precede the stop than fit, the list keeps the
+/// most recent ones so the failure that stopped the turn stays visible.
+#[test]
+fn a_capped_summary_keeps_the_most_recent_groups() {
+ let mut results: Vec<_> = (0..MAX_LISTED + 2)
+ .map(|i| result(&format!("early_tool_{i}"), true, "ok"))
+ .collect();
+ results.push(result("final_blocker", false, "boom happened"));
+ let out = build_deterministic_final_summary(&results, StopReasonKind::RepeatedFailure);
+ assert!(out.contains("final_blocker"), "{out}");
+ assert!(!out.contains("early_tool_0`"), "{out}");
+ assert!(out.contains("more tool call(s)"), "{out}");
+}
diff --git a/crates/openhuman-core/src/integrations/composio/tools_direct_mode_routing_tests.rs b/crates/openhuman-core/src/integrations/composio/tools_direct_mode_routing_tests.rs
index 8bf3204da1..aac6bfa427 100644
--- a/crates/openhuman-core/src/integrations/composio/tools_direct_mode_routing_tests.rs
+++ b/crates/openhuman-core/src/integrations/composio/tools_direct_mode_routing_tests.rs
@@ -335,6 +335,16 @@ fn composio_connect_outlives_its_approval_park() {
);
}
+#[test]
+fn composio_connect_timeout_saturates_instead_of_overflowing() {
+ // `u64::MAX` seconds plus the slack must not panic in `Duration` addition.
+ let bound = std::time::Duration::from_secs(u64::MAX);
+ assert_eq!(
+ composio_connect_tool_timeout(Some(bound)),
+ tinytools::ToolTimeout::Millis(u64::MAX)
+ );
+}
+
#[test]
fn parse_composio_connect_timeout_honors_override_and_zero_opt_out() {
// Explicit value → that many seconds.