Skip to content

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

test: align subagent and tool policy tests with owner-scoped routing

Steven Enamakel13105dbc1c51
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_tests.rs
index bfb02e0eb6..04c647d7d0 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_tests.rs
@@ -38,7 +38,8 @@ async fn spawn_subagent_tool_runs_child_agent_e2e() {
}),
None,
live.data.child(),
- Some(&live),
+ crate::agent::subagent_host::detached_subagent_parent(&live, "spawn-subagent-child")
+ .expect("detached parent"),
))
.await
.expect("tool execution");
@@ -89,7 +90,8 @@ async fn spawn_subagent_reports_a_stopped_child_as_a_failed_tool_result() {
}),
None,
run_context,
- Some(&live),
+ crate::agent::subagent_host::detached_subagent_parent(&live, "stopped-child")
+ .expect("detached parent"),
))
.await
.expect("tool execution");
diff --git a/crates/openhuman-core/src/agent/subagent_host/ops_tests_driver_bridge_tests.rs b/crates/openhuman-core/src/agent/subagent_host/ops_tests_driver_bridge_tests.rs
index 8e871e1325..4681382099 100644
--- a/crates/openhuman-core/src/agent/subagent_host/ops_tests_driver_bridge_tests.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/ops_tests_driver_bridge_tests.rs
@@ -379,6 +379,13 @@ async fn closing_a_durable_driver_session_cancels_only_its_registered_child() {
Some("close-driver-thread".into()),
)
.with_jobs(jobs.clone());
+ let owner = crate::agent::tinyagents::tool_registration::subagent_owner_key(
+ &workspace,
+ "test-session",
+ Some("close-driver-thread"),
+ );
+ let owner_scope: std::sync::Arc<dyn Fn(u64) -> String + Send + Sync> =
+ std::sync::Arc::new(move |_| owner.clone());
assert!(port
.close("close-driver-session")
.await
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware_tool_policy_tests.rs b/crates/openhuman-core/src/agent/tinyagents/middleware_tool_policy_tests.rs
index 158b636ac2..47a413fa85 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware_tool_policy_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware_tool_policy_tests.rs
@@ -369,11 +369,7 @@ async fn a_prompt_hidden_delegate_is_not_offered_as_a_direct_route() {
let mut tools: Vec<Box<dyn tinytools::Tool>> = vec![
Box::new(RoutingFakeTool("propose_workflow")),
- Box::new(ArchetypeDelegationTool {
- tool_name: "build_workflow".to_string(),
- agent_id: DelegationTarget("workflow_builder".to_string()),
- tool_description: "Build a workflow".to_string(),
- }),
+ Box::new(RoutingFakeTool("build_workflow")),
];
append_pack_tools(&mut tools);
let tools = Arc::new(tools);
@@ -411,10 +407,6 @@ async fn a_prompt_hidden_delegate_is_not_offered_as_a_direct_route() {
!route.contains("Call `build_workflow`"),
"a prompt-hidden delegate must not be advertised as a direct call: {route}"
);
- assert!(
- route.contains("workflow_builder"),
- "the hint must fall back to naming the owning agent: {route}"
- );
}
/// #6302: an invented tool name inside `use_skill` is "no such tool", not a