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(subagent): warn only when the allowlist readmitted a spawn tool
Shanu37cc618b2c82
diff --git a/src/openhuman/agent/tinyagents/mod_part_01.rs b/src/openhuman/agent/tinyagents/mod_part_01.rsindex eea9879246..a6e7725a62 100644--- a/src/openhuman/agent/tinyagents/mod_part_01.rs+++ b/src/openhuman/agent/tinyagents/mod_part_01.rs@@ -534,12 +534,22 @@ pub(crate) async fn run_turn_via_tinyagents(/// name the tools that pause the loop (e.g. `ask_user_clarification`) and surface/// the question via [`TinyagentsTurnOutcome::early_exit_tool`]./// True when `name` is a sub-agent spawn/delegation tool that a **child** run-/// must never be able to invoke (issue #4452). Mirrors the caller-side strip in-/// `subagent_runner::tool_prep::is_subagent_spawn_tool` plus the worker-thread-/// spawn, re-asserted at registration as defense-in-depth so a misconfigured-/// allowlist cannot reintroduce sub-agent spawning into a nested run. Kept local-/// to this seam (rather than importing the `pub(super)` runner helper) so the-/// invariant travels with the registration site that enforces it.+/// 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. Kept local to this seam (rather than importing+/// the `pub(super)` runner helper) so the invariant travels with the+/// registration site that enforces it.+///+/// **This is a strict subset of the caller-side strip**, not a mirror of it+/// (issue #6157). `subagent_runner::tool_prep::is_subagent_spawn_tool` also+/// resolves each archetype's `delegate_name` override through the definition+/// registry — `plan`, `research`, `run_code`, `review_code`, … — none of which+/// carry the `delegate_` prefix this match relies on. Matching them here would+/// put a registry lookup on the per-tool registration loop, so the caller+/// stays responsible for the override names: every path that feeds `allowed`+/// runs `is_subagent_spawn_tool` first, including the dynamic per-spawn tools+/// (`subagent_runner::ops::runner`). Widen this predicate in lockstep if that+/// ever stops being true.fn is_subagent_spawn_or_delegate_tool(name: &str) -> bool {name == "spawn_subagent"|| name.starts_with("delegate_")diff --git a/src/openhuman/agent/tinyagents/mod_part_04.rs b/src/openhuman/agent/tinyagents/mod_part_04.rsindex 4456d54895..bb8125da6d 100644--- a/src/openhuman/agent/tinyagents/mod_part_04.rs+++ b/src/openhuman/agent/tinyagents/mod_part_04.rs@@ -253,12 +253,12 @@ fn assemble_turn_harness(Some(set) => set.contains(name),};// Defense-in-depth (issue #4452): a sub-agent must NEVER be handed a- // spawn/delegate tool, regardless of what the resolved allowlist contains.- // Re-assert the invariant here at registration time (not just on the- // caller's `allowed_indices`) so a misbuilt allowlist can't reintroduce- // `spawn_subagent`/`delegate_*`/worker-thread spawning into a child run.+ // spawn/delegate tool whatever the allowlist says — re-assert it here at+ // registration, not just on the caller's `allowed_indices`. Warn only when+ // the allowlist actually readmitted one (issue #6157); the caller strips+ // them first, so a bare `spawn_stripped` warn fired on every healthy run.let spawn_stripped = is_subagent_run && is_subagent_spawn_or_delegate_tool(name);- if spawn_stripped {+ if spawn_stripped && admitted {tracing::warn!(tool = name,"[subagent] refusing to register spawn/delegate tool on sub-agent run"