Skip to content

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

fix(session_host): keep packed tools in subagent tool ceiling

Steven Enamakel7a46239fb695
diff --git a/crates/openhuman-core/src/agent/session_host/builder/builder_build.rs b/crates/openhuman-core/src/agent/session_host/builder/builder_build.rs
index e55032ad8a..057a76c3cc 100644
--- a/crates/openhuman-core/src/agent/session_host/builder/builder_build.rs
+++ b/crates/openhuman-core/src/agent/session_host/builder/builder_build.rs
@@ -264,11 +264,22 @@ impl SessionHostBuilder {
);
let mut subagent_tool_ceiling_names = self.subagent_tool_ceiling_names.unwrap_or_default();
if channel_policy_session.has_restrictions() {
- let policy_allowed: std::collections::HashSet<String> = tool_specs
+ let mut policy_allowed: std::collections::HashSet<String> = tool_specs
.iter()
.filter(|spec| channel_policy_session.is_allowed(&spec.name))
.map(|spec| spec.name.clone())
.collect();
+ // Packed tools are the owning specialist's belt, not this agent's:
+ // they are absent from `tool_specs` (reached through `use_skill` or a
+ // hand-off), so a ceiling taken from that list alone would strip a
+ // child of its own tools (`skill_setup` could not search or install).
+ // The child builds its own policy session, which still applies the
+ // channel's permission levels to them.
+ policy_allowed.extend(
+ crate::tools::toolpacks::all_packed_tool_names()
+ .into_iter()
+ .map(str::to_owned),
+ );
if subagent_tool_ceiling_names.is_empty() {
subagent_tool_ceiling_names = policy_allowed;
} else {