Skip to content

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

refactor(tinyagents): narrow subagent spawn tool detection

Steven Enamakel89bcf791311c
diff --git a/crates/openhuman-core/src/agent/tinyagents/turn_policy.rs b/crates/openhuman-core/src/agent/tinyagents/turn_policy.rs
index 0d9c5bca64..2f20cbc3ee 100644
--- a/crates/openhuman-core/src/agent/tinyagents/turn_policy.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/turn_policy.rs
@@ -155,14 +155,9 @@ pub(crate) fn tool_call_limit(max_iterations: usize, cap: Option<usize>) -> usiz
/// must never be able to invoke (issue #4452), re-asserted at registration as
/// defense-in-depth so a misconfigured allowlist cannot reintroduce sub-agent
/// spawning into a nested run. It shares TinyAgents' canonical spawn names and
-/// the host's fixed continuation control; the caller-side strip additionally
-/// resolves unprefixed `delegate_name` overrides through the registry.
+/// the host's single spawn surface.
pub(crate) fn is_subagent_spawn_or_delegate_tool(name: &str) -> bool {
- const HOST_SPAWN_TOOL_NAMES: &[&str] = &["continue_subagent"];
-
- tinyagents_definition::SPAWN_TOOL_NAMES.contains(&name)
- || HOST_SPAWN_TOOL_NAMES.contains(&name)
- || name.starts_with("delegate_")
+ name == "spawn_subagent" || tinyagents_definition::SPAWN_TOOL_NAMES.contains(&name)
}
#[cfg(test)]