Skip to content

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

test: tighten tool policy and routing prompt assertions

Steven Enamakel602bef200a27
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 2715f9ead4..1df05629b3 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
@@ -193,7 +193,9 @@ async fn a_use_skill_listing_hides_what_this_session_cannot_call_and_names_the_r
result_text(&result)
);
assert!(
- result_text(&result).contains("Call `spawn_subagent` instead"),
+ result_text(&result).contains("Call `spawn_subagent` to delegate")
+ && (result_text(&result).contains("workflow_builder")
+ || result_text(&result).contains("flow_discovery")),
"the empty listing must name the callable owner hand-off:\n{}",
result_text(&result)
);
@@ -442,7 +444,8 @@ async fn an_invented_tool_name_in_a_skill_is_not_reported_as_a_denial() {
"an invented name must not read as a permission denial: {message}"
);
assert!(
- message.contains("Call `spawn_subagent` instead"),
+ message.contains("Call `spawn_subagent` to delegate")
+ && (message.contains("workflow_builder") || message.contains("flow_discovery")),
"the answer must name what this session can call in the skill: {message}"
);
}
diff --git a/crates/openhuman-core/src/agent_registry/agents/orchestrator/prompt_tests_session_routing_tests.rs b/crates/openhuman-core/src/agent_registry/agents/orchestrator/prompt_tests_session_routing_tests.rs
index a6b6057ac4..97453c7dfa 100644
--- a/crates/openhuman-core/src/agent_registry/agents/orchestrator/prompt_tests_session_routing_tests.rs
+++ b/crates/openhuman-core/src/agent_registry/agents/orchestrator/prompt_tests_session_routing_tests.rs
@@ -66,8 +66,8 @@ fn prompt_routes_workflow_authoring_to_the_builder_not_use_skill() {
// The gate is the fix; this pins the prompt so the model is told the route
// before it discovers the wall.
assert!(
- ARCHETYPE.contains("Build or edit a workflow with agent_id: \"workflow_builder\"")
- && ARCHETYPE.contains("Spawn specialist work with `spawn_subagent`"),
+ ARCHETYPE.contains("Build or edit a workflow with `agent_id: \"workflow_builder\"`")
+ && ARCHETYPE.contains("Spawn specialist work with `spawn_subagent{agent_id, prompt, task_key}`"),
"orchestrator prompt must carry the workflow routing rule and name the spawn to make"
);