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
Revert "fix(tinyagents): return denied tool hooks as failed results"
Steven Enamakel1cb5c671bbba
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/embedder_hooks.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/embedder_hooks.rsindex 55a756dc17..f91c2edb14 100644--- a/crates/openhuman-core/src/agent/tinyagents/middleware/embedder_hooks.rs+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/embedder_hooks.rs@@ -105,22 +105,12 @@ impl Middleware<(), crate::agent::tinyagents::host::OpenHumanRunContext>call.arguments = arguments.clone();context.arguments = arguments;}- // A refusal is the model's answer, not a failure of the run:- // `ToolFailed` hands it back as a failed tool result and the- // turn carries on, as `ToolHookDecision::Deny` documents.crate::agent::hooks::ToolHookDecision::Deny(reason) => {- tracing::debug!(- hook = hook.name(),- tool = context.tool_name,- "[tinyagents::mw] tool hook denied the call"- );- return Err(tinyagents_harness::error::TinyAgentsError::ToolFailed(- format!(- "tool hook '{}' denied {}: {reason}",- hook.name(),- context.tool_name- ),- ));+ return Err(tinyagents_harness::error::TinyAgentsError::Tool(format!(+ "tool hook '{}' denied {}: {reason}",+ hook.name(),+ context.tool_name+ )));}// There is no approval channel inside a middleware, and a hook// that asks for a human is asking for something stricter than@@ -134,13 +124,11 @@ impl Middleware<(), crate::agent::tinyagents::host::OpenHumanRunContext>"[tinyagents::mw] tool hook requested approval; denying in a \non-interactive middleware");- return Err(tinyagents_harness::error::TinyAgentsError::ToolFailed(- format!(- "tool hook '{}' requires approval for {}: {reason}",- hook.name(),- context.tool_name- ),- ));+ return Err(tinyagents_harness::error::TinyAgentsError::Tool(format!(+ "tool hook '{}' requires approval for {}: {reason}",+ hook.name(),+ context.tool_name+ )));}}}