Skip to content

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

test(session-host): improve failure output for hidden tool prompt assertion

Steven Enamakeld3bdbfc61514
diff --git a/crates/openhuman-core/src/agent/session_host/runtime_session/tool_rules_tests.rs b/crates/openhuman-core/src/agent/session_host/runtime_session/tool_rules_tests.rs
index 3651a5aa08..8390184573 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime_session/tool_rules_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_session/tool_rules_tests.rs
@@ -86,7 +86,8 @@ async fn a_rule_hidden_tool_leaves_the_rendered_prompt_but_stays_declared() {
!prompt.contains("goal_complete"),
"a hidden tool is not catalogued"
);
- assert!(prompt.contains("goal_set"), "other tools still are: {}", &prompt[prompt.len().saturating_sub(3000)..]);
+ let goals: Vec<&str> = prompt.match_indices("goal_").map(|(i, _)| &prompt[i..(i + 14).min(prompt.len())]).collect();
+ assert!(prompt.contains("goal_set"), "other tools still are: {goals:?} len={}", prompt.len());
let declared = prelude
.prepare(true)
.await