Skip to content

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

fix(fleet_tools): handle empty fleet name in tool call

Steven Enamakel96767a46619e
diff --git a/crates/openhuman-core/src/agent/orchestration/fleet_tools.rs b/crates/openhuman-core/src/agent/orchestration/fleet_tools.rs
index 37b0a0ba85..1d01d9f9e7 100644
--- a/crates/openhuman-core/src/agent/orchestration/fleet_tools.rs
+++ b/crates/openhuman-core/src/agent/orchestration/fleet_tools.rs
@@ -57,6 +57,23 @@ impl FleetToolSet {
Self::from_scope(&definition.tools, &definition.disallowed_tools)
}
+ /// Resolve the set from a turn's *effective* visible tool names — the
+ /// live, already-filtered membership set (hides, named restrictions, and
+ /// policy narrowing all applied), as opposed to [`Self::for_parent`]'s
+ /// static read of the parent's registered definition. Prefer this
+ /// whenever the caller already has that snapshot: a hide or restriction
+ /// applied mid-session can narrow a turn's real tool surface below what
+ /// the definition alone would suggest, and offering a control absent
+ /// from this snapshot invites a denied tool call.
+ pub(crate) fn from_visible_tool_names(names: &std::collections::HashSet<String>) -> Self {
+ let available = FLEET_TOOLS
+ .iter()
+ .copied()
+ .filter(|name| names.contains(*name))
+ .collect();
+ Self { available }
+ }
+
/// Derive the set from a definition's tool scope and denylist. A
/// `Named` scope exposes exactly the fleet tools it lists; `Wildcard`
/// exposes all of them. `disallowed_tools` (exact or trailing-`*`