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(toolpacks): pack setup_skills hand-off and remove unpacked list
Steven Enamakeld2cd25efcb83
diff --git a/crates/openhuman-core/src/tools/toolpacks/registry.rs b/crates/openhuman-core/src/tools/toolpacks/registry.rsindex b523cba647..6a2348f970 100644--- a/crates/openhuman-core/src/tools/toolpacks/registry.rs+++ b/crates/openhuman-core/src/tools/toolpacks/registry.rs@@ -432,26 +432,6 @@ pub(crate) const DELIBERATELY_UNPACKED_FLEET_TOOLS: &[&str] = &["spawn_parallel_agents",];-/// The skill hand-offs are deliberately not packed (#6302).-///-/// `setup_skills` is the orchestrator's route into the skills family (it once-/// shared this list with `run_skill`, whose job is now the orchestrator's own-/// `run_workflow`). Packed, they sat in the same listing as the raw-/// `skill_registry_*` tools, one `use_skill` round trip-/// away, and a live account showed the cost: across 11 turns the orchestrator-/// called the raw tools itself, guessed at tool names, and never handed off.-/// Handing off is the most common thing it does with these families, so the-/// `collapsed_delegation.rs` argument applies: frequency of use decides, and-/// delegation should not pay a round trip.-///-/// With a hand-off on the belt, `ops::closed_by_direct_handoff` closes the-/// owning pack's raw tools to the caller, so the hand-off is its only route.-/// The other packed hand-offs (`manage_tasks`, `build_workflow`,-/// `discover_workflows`, `make_presentation`, ...) stay packed: each is its own-/// token-cost decision, and the same closing rule takes effect for any of them-/// as soon as it is unpacked and listed here.-#[cfg(test)]-pub(crate) const DELIBERATELY_UNPACKED_HANDOFFS: &[&str] = &[];pub fn pack(id: &str) -> Option<&'static ToolPack> {PACKS.iter().find(|p| p.id == id)diff --git a/crates/openhuman-core/src/tools/toolpacks/toolpacks_tests.rs b/crates/openhuman-core/src/tools/toolpacks/toolpacks_tests.rsindex 44f4c4f8e8..2c6a91ea37 100644--- a/crates/openhuman-core/src/tools/toolpacks/toolpacks_tests.rs+++ b/crates/openhuman-core/src/tools/toolpacks/toolpacks_tests.rs@@ -511,6 +511,7 @@ fn every_pack_declares_the_tools_it_is_named_for() {// skills whose `describe_workflow` / run route were still// withheld — 748 B on every wildcard agent for a doorway to a// locked room.+ "setup_skills","skill_search","skill_registry_browse","skill_registry_search",diff --git a/crates/openhuman-core/src/tools/toolpacks/toolpacks_tests_scoping_and_visibility_tests.rs b/crates/openhuman-core/src/tools/toolpacks/toolpacks_tests_scoping_and_visibility_tests.rsindex da1e7fe1d0..24e88d0240 100644--- a/crates/openhuman-core/src/tools/toolpacks/toolpacks_tests_scoping_and_visibility_tests.rs+++ b/crates/openhuman-core/src/tools/toolpacks/toolpacks_tests_scoping_and_visibility_tests.rs@@ -313,15 +313,16 @@ fn the_workflows_pack_is_still_owned_by_the_flow_agents() {// ── #6302: the MCP and skill hand-offs, and the packs they close ───────────-/// The four hand-offs stay direct tools. See `DELIBERATELY_UNPACKED_HANDOFFS`.+/// `setup_skills` is a packed hand-off like `build_workflow` and+/// `manage_tasks`: it rides in the `skills` pack it hands off into, so the+/// orchestrator reaches it through `use_skill` instead of paying its schema on+/// every request.#[test]-fn the_mcp_and_skill_hand_offs_are_never_packed() {- for name in registry::DELIBERATELY_UNPACKED_HANDOFFS {- assert!(- registry::pack_for_tool(name).is_none(),- "`{name}` is the orchestrator's route into its family and must stay a direct tool"- );- }+fn the_skill_install_hand_off_is_packed_in_the_skills_pack() {+ assert_eq!(+ registry::pack_for_tool("setup_skills").map(|pack| pack.id),+ Some("skills")+ );}/// A pack whose owner this agent can hand off to directly is closed to it@@ -338,8 +339,11 @@ fn a_direct_hand_off_closes_its_owners_pack_and_nothing_else() {tool_description: String::new(),})};+ // `hand_off_to_skill_setup` is a hypothetical UNPACKED hand-off to the+ // skills pack's owner (the real one, `setup_skills`, is packed now; see+ // `a_packed_hand_off_leaves_its_owners_pack_open`).let delegates = vec![- delegate("setup_skills", "skill_setup"),+ delegate("hand_off_to_skill_setup", "skill_setup"),delegate("create_image", "image_agent"),];let raw = registry_with_all(&[@@ -353,12 +357,12 @@ fn a_direct_hand_off_closes_its_owners_pack_and_nothing_else() {.map(|t| t.as_ref()).chain(delegates.iter().map(|t| t.as_ref())).collect();- // `setup_skills` is unpacked, so the orchestrator advertises it by- // construction; `create_image` is packed.+ // `hand_off_to_skill_setup` is unpacked, so the orchestrator advertises it+ // by construction; `create_image` is packed.let closed = closed_by_direct_handoff("orchestrator", &tools);assert!(closed.contains(&"skill_registry_install"),- "a raw tool of the pack `setup_skills` hands off to must close: {closed:?}"+ "a raw tool of the pack an unpacked hand-off leads to must close: {closed:?}");assert!(!closed.contains(&"media_generate_image"),@@ -391,6 +395,32 @@ fn a_direct_hand_off_closes_its_owners_pack_and_nothing_else() {);}+/// The real skill-install hand-off is packed, so it no longer closes the pack:+/// the `skills` listing offers `setup_skills` beside the raw registry tools,+/// the shape every other packed hand-off (`build_workflow`, `manage_tasks`)+/// already has.+#[test]+fn a_packed_hand_off_leaves_its_owners_pack_open() {+ use crate::agent::orchestration::tools::{ArchetypeDelegationTool, DelegationTarget};++ let delegate: Box<dyn tinytools::Tool> = Box::new(ArchetypeDelegationTool {+ tool_name: "setup_skills".to_string(),+ agent_id: DelegationTarget("skill_setup".to_string()),+ tool_description: String::new(),+ });+ let raw = registry_with_all(&["skill_registry_install"]);+ let tools: Vec<&dyn tinytools::Tool> = raw+ .iter()+ .map(|t| t.as_ref())+ .chain(std::iter::once(delegate.as_ref()))+ .collect();+ let closed = closed_by_direct_handoff("orchestrator", &tools);+ assert!(+ !closed.contains(&"skill_registry_install"),+ "a packed hand-off must not close its own pack: {closed:?}"+ );+}+/// The live session shape, which the rule test above cannot catch.////// This is the regression the first cut shipped (#6302): a `ToolScope::Named`@@ -412,7 +442,7 @@ fn a_named_scope_session_closes_the_pack_its_visible_list_never_mentions() {use crate::tools::agent_policy::ToolPolicyEngine;let delegate: Box<dyn tinytools::Tool> = Box::new(ArchetypeDelegationTool {- tool_name: "setup_skills".to_string(),+ tool_name: "hand_off_to_skill_setup".to_string(),agent_id: DelegationTarget("skill_setup".to_string()),tool_description: String::new(),});@@ -450,8 +480,8 @@ fn a_named_scope_session_closes_the_pack_its_visible_list_never_mentions() {session.decision_for("skill_registry_install").blocks_execution(),- "`setup_skills` is unpacked, so the orchestrator advertises it and the \- raw registry tool must close — even though `visible` never named it"+ "an unpacked hand-off is advertised by construction, so the raw \+ registry tool must close — even though `visible` never named it");}