Skip to content

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

refactor(orchestrator): drop unused registry argument from tool collection

Steven Enamakel8f83f89d1d6d
diff --git a/crates/openhuman-core/src/agent/session_host/builder/factory.rs b/crates/openhuman-core/src/agent/session_host/builder/factory.rs
index 1076aabb0c..41ed8b70d4 100644
--- a/crates/openhuman-core/src/agent/session_host/builder/factory.rs
+++ b/crates/openhuman-core/src/agent/session_host/builder/factory.rs
@@ -425,7 +425,6 @@ impl OpenHumanSessionHost {
let synthed = if should_synthesize_delegation_tools(def) {
tools::orchestrator_tools::collect_orchestrator_tools(
def,
- &reg,
prewarmed_integrations_slice,
)
} else {
@@ -485,7 +484,6 @@ impl OpenHumanSessionHost {
let synthed = match reg.get("orchestrator") {
Some(orch_def) => tools::orchestrator_tools::collect_orchestrator_tools(
orch_def,
- &reg,
prewarmed_integrations_slice,
),
None => {
diff --git a/crates/openhuman-core/src/agent/session_host/runtime_session_tool_surface.rs b/crates/openhuman-core/src/agent/session_host/runtime_session_tool_surface.rs
index 4597a8b31e..77cfced345 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime_session_tool_surface.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_session_tool_surface.rs
@@ -103,7 +103,7 @@ impl OpenHumanTurnPrelude {
.unwrap_or_else(std::sync::PoisonError::into_inner);
let mut collected = definition
.as_ref()
- .map(|definition| collect_orchestrator_tools(definition, &registry, &integrations))
+ .map(|definition| collect_orchestrator_tools(definition, &integrations))
.unwrap_or_default();
#[cfg(feature = "mcp")]
collected.extend(mcp_tools);
diff --git a/crates/openhuman-core/src/channels/runtime/dispatch/routing.rs b/crates/openhuman-core/src/channels/runtime/dispatch/routing.rs
index fe3044fa66..57e91e2e53 100644
--- a/crates/openhuman-core/src/channels/runtime/dispatch/routing.rs
+++ b/crates/openhuman-core/src/channels/runtime/dispatch/routing.rs
@@ -152,7 +152,7 @@ pub(super) async fn resolve_target_agent(channel: &str) -> AgentScoping {
connected_integration_count = connected.len(),
"[dispatch::routing] fetched connected integrations for delegation expansion"
);
- orchestrator_tools::collect_orchestrator_tools(definition, &registry, &connected)
+ orchestrator_tools::collect_orchestrator_tools(definition, &connected)
} else {
Vec::new()
};
diff --git a/crates/openhuman-core/src/tools/orchestrator_tools_tests.rs b/crates/openhuman-core/src/tools/orchestrator_tools_tests.rs
new file mode 100644
index 0000000000..822d2a7a62
--- /dev/null
+++ b/crates/openhuman-core/src/tools/orchestrator_tools_tests.rs
@@ -0,0 +1,64 @@
+use super::*;
+use tinyagents_definition::{
+ DefinitionSource, ModelSpec, PromptSource, SandboxMode, SkillsWildcard, ToolScope,
+};
+
+fn orchestrator() -> AgentDefinition {
+ AgentDefinition {
+ id: "orchestrator".into(),
+ when_to_use: String::new(),
+ display_name: None,
+ system_prompt: PromptSource::Inline(String::new()),
+ model: ModelSpec::Inherit,
+ temperature: 0.4,
+ tools: ToolScope::Wildcard,
+ disallowed_tools: vec![],
+ skill_filter: None,
+ extra_tools: vec![],
+ deferred_tools: Vec::new(),
+ tool_rules: None,
+ max_iterations: 8,
+ iteration_policy: Default::default(),
+ max_result_chars: None,
+ max_turn_output_tokens: None,
+ timeout_secs: None,
+ sandbox_mode: SandboxMode::None,
+ background: false,
+ subagents: vec![
+ SubagentEntry::AgentId("image_agent".into()),
+ SubagentEntry::AgentId("research_agent".into()),
+ SubagentEntry::Skills(SkillsWildcard { skills: "*".into() }),
+ ],
+ delegate_name: None,
+ agent_tier: tinyagents_definition::AgentTier::Worker,
+ source: DefinitionSource::Builtin,
+ extensions: crate::agent_registry::host_definition::AgentExt {
+ omit_identity: true,
+ omit_memory_context: true,
+ omit_safety_preamble: true,
+ tokenjuice_compression: tinyjuice_bus::types::AgentTokenjuiceCompression::Auto,
+ searches_connected_mcp: false,
+ ..Default::default()
+ },
+ role: None,
+ }
+}
+
+#[test]
+fn agent_id_allowlist_entries_do_not_synthesize_model_facing_dispatch_tools() {
+ let tools = collect_orchestrator_tools(&orchestrator(), &[]);
+
+ assert!(tools.is_empty());
+ let spawn = crate::agent::registration::dialogue_tools(
+ std::path::Path::new("."),
+ &crate::config::Config::default(),
+ );
+ let subagent_tools: Vec<_> = spawn
+ .iter()
+ .filter(|tool| {
+ tool.name().contains("subagent") || tool.name().starts_with("delegate_")
+ })
+ .map(|tool| tool.name())
+ .collect();
+ assert_eq!(subagent_tools, ["spawn_subagent"]);
+}