Skip to content

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

feat(flows): add builder gate capability for agent flows

Steven Enamakelad62dec5af7e
diff --git a/crates/openhuman-core/src/agent/registry/rpc.rs b/crates/openhuman-core/src/agent/registry/rpc.rs
index 0e45fad185..5f49e6fb8a 100644
--- a/crates/openhuman-core/src/agent/registry/rpc.rs
+++ b/crates/openhuman-core/src/agent/registry/rpc.rs
@@ -40,6 +40,7 @@ pub struct AvailableToolsResponse {
}
pub async fn available_tools_rpc(
+ ctx: &DispatchCtx,
_req: AvailableToolsRequest,
) -> Result<Outcome<AvailableToolsResponse>, String> {
Ok(Outcome::new(
diff --git a/crates/openhuman-core/src/flows/builder_host.rs b/crates/openhuman-core/src/flows/builder_host.rs
index 72dd1cf945..bbe1098195 100644
--- a/crates/openhuman-core/src/flows/builder_host.rs
+++ b/crates/openhuman-core/src/flows/builder_host.rs
@@ -222,7 +222,7 @@ impl BuilderGates for FlowsHost {
#[async_trait]
impl AgentDirectory for FlowsHost {
async fn list(&self) -> PortResult<Vec<AgentDefinition>> {
- let agents = crate::agent::registry::list_agents(false)
+ let agents = crate::agent::registry::list_agents(&crate::core::runtime::DispatchCtx::ambient(), false)
.await
.map_err(|e| e.to_string())?;
Ok(agents
diff --git a/crates/openhuman-core/src/flows/ops/builder_gates.rs b/crates/openhuman-core/src/flows/ops/builder_gates.rs
index d0a0081e05..fd074f4c76 100644
--- a/crates/openhuman-core/src/flows/ops/builder_gates.rs
+++ b/crates/openhuman-core/src/flows/ops/builder_gates.rs
@@ -384,7 +384,7 @@ pub(crate) async fn validate_agent_refs(config: &Config, graph: &WorkflowGraph)
}
AgentRoute::RegistryFallback => {
if custom_registry.is_none() {
- custom_registry = Some(crate::agent::registry::list_agents(true).await);
+ custom_registry = Some(crate::agent::registry::list_agents(&crate::core::runtime::DispatchCtx::ambient(), true).await);
}
match custom_registry.as_ref().expect("just populated") {
Ok(entries) => match entries.iter().find(|entry| entry.id == agent_ref) {
diff --git a/crates/openhuman-core/src/flows/tinyflows/caps/agent.rs b/crates/openhuman-core/src/flows/tinyflows/caps/agent.rs
index f988b1fc3e..4193e22995 100644
--- a/crates/openhuman-core/src/flows/tinyflows/caps/agent.rs
+++ b/crates/openhuman-core/src/flows/tinyflows/caps/agent.rs
@@ -509,7 +509,7 @@ impl OpenHumanAgentRunner {
conn: Option<&str>,
) -> Result<Value> {
// Resolve + validate the requested agent kind against the registry.
- let entry = crate::agent::registry::get_agent(agent_ref)
+ let entry = crate::agent::registry::get_agent(&crate::core::runtime::DispatchCtx::ambient(), agent_ref)
.await
.map_err(EngineError::Capability)?
.ok_or_else(|| {