Skip to content

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

test: add tests for orchestrator prompt and session routing

Steven Enamakel1f940b241f3a
diff --git a/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt_tests.rs b/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt_tests.rs
index 219e53aeb2..5bb40dd8ea 100644
--- a/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/orchestrator/prompt_tests.rs
@@ -310,17 +310,19 @@ fn build_includes_direct_first_decision_tree() {
}
#[test]
-fn build_routes_live_facts_to_research_tool() {
+fn build_routes_live_facts_to_the_web_tools_directly() {
let body = build(&ctx_with(&[])).unwrap();
- assert!(body.contains("via `research`"));
+ // There is no research sub-agent: broad research is a deep web answer or
+ // search plus a batched contents read, done by the orchestrator itself.
+ assert!(body.contains("anything broader via deep `web_answer_tool`"));
+ assert!(body.contains("`depth: \"deep\"`"));
+ assert!(body.contains("`web_contents_tool`"));
+ assert!(!body.contains("`research`"), "the removed research delegate must not be named");
assert!(body.contains("weather, forecasts, prices, recent news"));
assert!(body.contains("\"use live data\""));
// A lead-in line is welcome, but only in the same message as the call.
assert!(body.contains("an announced search never runs: emit it"));
- assert!(
- !body.contains("delegate_researcher"),
- "orchestrator prompt should name the synthesized researcher tool"
- );
+ assert!(!body.contains("researcher"));
}
// Code tasks retain an explicit direct-execution contract in the prompt.
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 132c6e3f93..94fddac642 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
@@ -44,7 +44,7 @@ fn the_withheld_block_renders_for_a_renamed_session_with_a_filter() {
// A visible set shaped like the live one: the advertised delegates are in,
// the packed ones are not.
- let visible: HashSet<String> = ["research", "plan", "file_read", "goal_complete"]
+ let visible: HashSet<String> = ["run_code", "plan", "file_read", "goal_complete"]
.iter()
.map(|s| s.to_string())
.collect();
@@ -87,7 +87,7 @@ fn the_withheld_block_renders_for_a_renamed_session_with_a_filter() {
fn the_generated_block_has_no_stray_whitespace_runs() {
crate::agent::harness::definition::AgentDefinitionRegistry::init_global_builtins()
.expect("builtin agent definitions must load");
- let visible: HashSet<String> = ["research".to_string()].into_iter().collect();
+ let visible: HashSet<String> = ["run_code".to_string()].into_iter().collect();
let mut ctx = ctx_with(&[]);
ctx.agent_id = "orchestrator";
ctx.visible_tool_names = &visible;
@@ -165,7 +165,7 @@ fn prompt_routes_workflow_authoring_to_the_builder_not_use_skill() {
fn skill_sections_name_the_hand_off_this_session_can_call() {
crate::agent::harness::definition::AgentDefinitionRegistry::init_global_builtins()
.expect("builtin agent definitions must load");
- let belt: HashSet<String> = ["setup_skills", "run_skill", "research", "use_skill"]
+ let belt: HashSet<String> = ["setup_skills", "run_skill", "run_code", "use_skill"]
.iter()
.map(|s| s.to_string())
.collect();
@@ -202,7 +202,7 @@ fn skill_sections_name_the_hand_off_this_session_can_call() {
// A packed route needs `use_skill` on the belt. A session filtered down to
// neither the delegate nor `use_skill` cannot reach the specialist at all,
// and naming a call it cannot make is the bug, not the fix.
- let no_use_skill: HashSet<String> = ["setup_skills", "research"]
+ let no_use_skill: HashSet<String> = ["setup_skills", "run_code"]
.iter()
.map(|s| s.to_string())
.collect();
diff --git a/crates/openhuman-core/src/agent/registry/defaults_tests.rs b/crates/openhuman-core/src/agent/registry/defaults_tests.rs
index 2eb2eb2fce..a20032f39d 100644
--- a/crates/openhuman-core/src/agent/registry/defaults_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/defaults_tests.rs
@@ -5,7 +5,8 @@ fn default_agents_include_core_personas() {
let agents = default_agents();
let ids: Vec<&str> = agents.iter().map(|agent| agent.id.as_str()).collect();
assert!(ids.contains(&"orchestrator"));
- assert!(ids.contains(&"researcher"));
+ assert!(ids.contains(&"planner"));
+ assert!(!ids.contains(&"researcher"), "the researcher agent was removed");
assert!(ids.contains(&"code_executor"));
assert!(agents
.iter()