The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
fix(orchestrator): rename prompt_tests to clarify session routing scope
Steven Enamakel35c857ccd3df
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.rsindex 5bb40dd8ea..0f7874fbe6 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@@ -19,10 +19,10 @@ fn render_installed_skills_lists_skills_and_names_the_hand_offs_it_is_given() {];// #6302: the section names the hand-offs in the form the session can call// (`hand_off_route`), never a pack route or a tool it cannot see.- let out = render_installed_skills(&skills, Some("`run_skill`"), Some("`setup_skills`"));+ let out = render_installed_skills(&skills, Some("`run_workflow`"), Some("`setup_skills`"));assert!(out.contains("## Installed Skills"));assert!(- out.contains("`run_skill`") && out.contains("`setup_skills`"),+ out.contains("`run_workflow`") && out.contains("`setup_skills`"),"catalogue must name the run and install hand-offs it was given: {out}");assert!(@@ -42,7 +42,7 @@ fn render_installed_skills_lists_skills_and_names_the_hand_offs_it_is_given() {// No route: the section lists the skills and names no call at all.let unrouted = render_installed_skills(&skills, None, None);assert!(- !unrouted.contains("run_skill") && !unrouted.contains("setup_skills"),+ !unrouted.contains("run_workflow") && !unrouted.contains("setup_skills"),"with no route, no hand-off may be named: {unrouted}");}@@ -50,7 +50,7 @@ fn render_installed_skills_lists_skills_and_names_the_hand_offs_it_is_given() {#[test]fn render_installed_skills_empty_is_omitted() {assert_eq!(- render_installed_skills(&[], Some("`run_skill`"), Some("`setup_skills`")),+ render_installed_skills(&[], Some("`run_workflow`"), Some("`setup_skills`")),"");}@@ -325,16 +325,46 @@ fn build_routes_live_facts_to_the_web_tools_directly() {assert!(!body.contains("researcher"));}-// Code tasks retain an explicit direct-execution contract in the prompt.+// Code tasks retain an explicit direct-execution contract in the prompt, and+// there is no coding specialist to hand them to any more.#[test]-fn build_routes_code_repo_work_to_run_code_tool() {+fn build_keeps_code_work_direct_with_no_coding_hand_off() {let body = build(&ctx_with(&[])).unwrap();assert!(body.contains("Keep code work end-to-end"));- assert!(- !body.contains("delegate_run_code"),- "orchestrator prompt must name the synthesized `run_code` tool, \- not the nonexistent `delegate_run_code`"- );+ for gone in ["run_code", "delegate_run_code", "review_code"] {+ assert!(+ !body.contains(gone),+ "orchestrator prompt names `{gone}`, a hand-off that no longer exists"+ );+ }+}++/// The skills that replaced specialists are named in the prompt, and every one+/// it names is a real pack carrying a guide. The prompt against the pack table,+/// not against itself, so a rename on either side fails here.+#[test]+fn prompt_names_only_guided_skills_that_exist() {+ let section = ARCHETYPE+ .split("## Skills")+ .nth(1)+ .expect("orchestrator prompt must carry a `## Skills` section");+ for skill in ["coding", "system", "web3", "docs"] {+ assert!(+ section.contains(&format!("skill `{skill}`")),+ "`## Skills` must route to skill `{skill}`"+ );+ let pack = crate::tools::toolpacks::pack(skill)+ .unwrap_or_else(|| panic!("prompt names skill `{skill}`, which is not a pack"));+ assert!(!pack.guide.trim().is_empty(), "skill `{skill}` has no guide");+ }+}++/// Two rules bind before the model thinks to load a skill, so they live in the+/// prompt, not in a guide a model may never open.+#[test]+fn prompt_binds_money_and_service_actions_to_explicit_consent() {+ assert!(ARCHETYPE.contains("never move funds or execute a swap, bridge or contract call without the user's explicit yes"));+ assert!(ARCHETYPE.contains("never stop, shut down, uninstall or update OpenHuman's service without an explicit yes"));}#[test]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.rsindex 5a897fefee..63f32c9bd8 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> = ["run_code", "plan", "file_read", "goal_complete"]+ let visible: HashSet<String> = ["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> = ["run_code".to_string()].into_iter().collect();+ let visible: HashSet<String> = ["file_read".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", "run_code", "use_skill"]+ let belt: HashSet<String> = ["setup_skills", "run_workflow", "file_read", "use_skill"].iter().map(|s| s.to_string()).collect();@@ -177,22 +177,21 @@ fn skill_sections_name_the_hand_off_this_session_can_call() {hand_off_route(&ctx, "skill_setup").as_deref(),Some("`setup_skills`"));- assert_eq!(- hand_off_route(&ctx, "skill_executor").as_deref(),- Some("`run_skill`")- );- assert_eq!(hand_off_route(&ctx, "mcp_agent"), None);+ // Running a skill is the orchestrator's own `run_workflow`, not a hand-off.+ assert_eq!(run_workflow_route(&ctx).as_deref(), Some("`run_workflow`"));// Listed but held by a pack: name the call that actually reaches it.assert_eq!(- hand_off_route(&ctx, "crypto_agent").as_deref(),- Some("`use_skill { \"skill\": \"crypto\", \"tool\": \"do_crypto\" }`")+ hand_off_route(&ctx, "image_agent").as_deref(),+ Some("`use_skill { \"skill\": \"media\", \"tool\": \"create_image\" }`"));- // Not in the orchestrator's allowlist: no route, so name nothing.+ // Not in the orchestrator's allowlist: no route, so name nothing. `planner`+ // is registered for workflow runs but is not a chat delegate.assert_eq!(hand_off_route(&ctx, "summarizer"), None);+ assert_eq!(hand_off_route(&ctx, "planner"), None);// The generated withheld block no longer lists the unpacked hand-offs.let block = render_withheld_specialists(&ctx);- for handoff in ["setup_skills", "run_skill"] {+ for handoff in ["setup_skills", "run_workflow"] {assert!(!block.contains(handoff),"`{handoff}` is a direct tool and must not be listed as withheld:\n{block}"@@ -202,16 +201,21 @@ 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", "run_code"]+ let no_use_skill: HashSet<String> = ["setup_skills", "file_read"].iter().map(|s| s.to_string()).collect();ctx.visible_tool_names = &no_use_skill;assert_eq!(- hand_off_route(&ctx, "crypto_agent"),+ hand_off_route(&ctx, "image_agent"),None,"without `use_skill` there is no packed route to name");+ assert_eq!(+ run_workflow_route(&ctx),+ None,+ "without `run_workflow` on the belt there is no way to run a skill"+ );assert_eq!(hand_off_route(&ctx, "skill_setup").as_deref(),Some("`setup_skills`"),