Skip to content

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

test(delegate_graph): wire up the delegate graph test module

Steven Enamakelc1ed30d57c75
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/delegate_graph.rs b/crates/openhuman-core/src/agent/orchestration/tools/delegate_graph.rs
index 9e6ba9dc56..bdd2a4b29f 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/delegate_graph.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/delegate_graph.rs
@@ -90,6 +90,10 @@ impl DelegateGraphTool {
}
}
+#[cfg(test)]
+#[path = "delegate_graph_tests.rs"]
+mod tests;
+
#[async_trait]
impl Tool for DelegateGraphTool {
fn name(&self) -> &str {
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/delegate_graph_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/delegate_graph_tests.rs
new file mode 100644
index 0000000000..6db96643ab
--- /dev/null
+++ b/crates/openhuman-core/src/agent/orchestration/tools/delegate_graph_tests.rs
@@ -0,0 +1,23 @@
+use super::*;
+
+#[tokio::test]
+async fn validation_errors_name_the_delegate_graph_tool() {
+ let tool: Arc<dyn Tool> = Arc::new(DelegateGraphTool::new());
+ let dispatch = DelegateGraphDispatch::new(tool);
+ let parent = crate::agent::tinyhumans::host::OpenHumanRunContext::new()
+ .into_tinyagents(tinyagents_harness::context::RunConfig::new("delegate-graph-test"));
+
+ let result = dispatch
+ .execute(
+ &(),
+ tinyagents_harness::CallId::new("delegate-graph-test-call"),
+ serde_json::json!({"task": "test validation"}),
+ ToolCallOptions::default(),
+ &parent,
+ )
+ .await
+ .expect("validation returns a tool result");
+
+ assert!(result.is_error);
+ assert_eq!(result.output(), "delegate_graph: `agent_id` is required.");
+}