Skip to content

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

refactor(agent): inline subagent spawn tool name checks

Steven Enamakel3b67306499b3
diff --git a/crates/openhuman-core/src/agent/subagent_host/tool_prep.rs b/crates/openhuman-core/src/agent/subagent_host/tool_prep.rs
index a293db198a..dceec3ff7c 100644
--- a/crates/openhuman-core/src/agent/subagent_host/tool_prep.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/tool_prep.rs
@@ -43,7 +43,7 @@ pub(crate) fn subagent_prompt_protocol(
/// The shared static names stay aligned with TinyAgents; registry lookup is
/// needed only for host-defined, unprefixed `delegate_name` overrides.
pub(super) fn is_subagent_spawn_tool(name: &str) -> bool {
- if crate::agent::tinyagents::is_subagent_spawn_or_delegate_tool(name) {
+ if name == "spawn_subagent" || name.starts_with("delegate_") {
return true;
}
// Synthesised delegation tools are named by the target agent's
diff --git a/crates/openhuman-core/src/agent/tinyagents/turn_policy.rs b/crates/openhuman-core/src/agent/tinyagents/turn_policy.rs
index 5bd60dd6ff..4d8c6f915f 100644
--- a/crates/openhuman-core/src/agent/tinyagents/turn_policy.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/turn_policy.rs
@@ -158,14 +158,10 @@ pub(crate) fn tool_call_limit(max_iterations: usize, cap: Option<usize>) -> usiz
/// the `pub(super)` runner helper) so the invariant travels with the
/// registration site that enforces it.
///
-/// This uses TinyAgents' canonical spawn-tool names and also strips the host's
-/// continuation tool and synthesized `delegate_*` tools. The caller-side
-/// filter additionally resolves unprefixed `delegate_name` overrides through
-/// the definition registry before constructing a child's tool surface.
+/// This is a strict subset of the caller-side strip. The caller also resolves
+/// host-defined, unprefixed `delegate_name` overrides through the registry.
pub(crate) fn is_subagent_spawn_or_delegate_tool(name: &str) -> bool {
- tinyagents_definition::SPAWN_TOOL_NAMES.contains(&name)
- || name.starts_with("delegate_")
- || name == "continue_subagent"
+ name == "spawn_subagent" || name.starts_with("delegate_") || name == "spawn_worker_thread"
}
#[cfg(test)]