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
test(tinyagents): update nested call tests for generic tool hooks
Steven Enamakel4800b516330f
diff --git a/crates/openhuman-core/src/agent/tinyagents/nested_calls_tests.rs b/crates/openhuman-core/src/agent/tinyagents/nested_calls_tests.rsindex 5239db5315..9e527097e8 100644--- a/crates/openhuman-core/src/agent/tinyagents/nested_calls_tests.rs+++ b/crates/openhuman-core/src/agent/tinyagents/nested_calls_tests.rs@@ -27,9 +27,8 @@ use tinyinference_llm::providers::MockModel;use tinyinference_llm::tool::ToolCall;use tinytools::{PermissionLevel, Tool, ToolResult};-use crate::agent::hooks::{ToolHook, ToolHookContext, ToolHookDecision};+use tinyagents_hooks::tool::{ToolHook, ToolHookContext, ToolHookDecision, ToolHooksMiddleware};use crate::agent::tinyagents::host::{OpenHumanRunContext, OpenHumanSecurityGate};-use crate::agent::tinyagents::middleware::embedder_hooks::EmbedderToolHooksMiddleware;use crate::security::policy::{AutonomyLevel, SecurityPolicy};type Outcome = Result<ToolResult, String>;@@ -101,25 +100,27 @@ impl Tool for Caller {struct DenyNamed(&'static str);#[async_trait]-impl ToolHook for DenyNamed {+impl ToolHook<OpenHumanRunContext> for DenyNamed {fn name(&self) -> &str {"deny_named"}- async fn before_tool(&self, context: &ToolHookContext) -> anyhow::Result<()> {+ async fn before_tool(+ &self,+ _: &OpenHumanRunContext,+ context: &ToolHookContext,+ ) -> anyhow::Result<()> {if context.tool_name == self.0 {anyhow::bail!("{} is forbidden", self.0);}Ok(())}- async fn after_tool(&self, _context: &ToolHookContext) -> anyhow::Result<()> {+ async fn after_tool(+ &self,+ _: &OpenHumanRunContext,+ _context: &ToolHookContext,+ ) -> anyhow::Result<()> {Ok(())}- async fn before_tool_decision(&self, context: &ToolHookContext) -> ToolHookDecision {- match self.before_tool(context).await {- Ok(()) => ToolHookDecision::Proceed,- Err(error) => ToolHookDecision::Deny(format!("{error:#}")),- }- }}fn nested_enabled() -> RunPolicy {