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
refactor(embed): pass run context to tool hook callbacks
Steven Enamakela4231e362e36
diff --git a/crates/openhuman-embed/src/runtime/live_hooks.rs b/crates/openhuman-embed/src/runtime/live_hooks.rsindex 0de2d59a6c..aa9c9a6165 100644--- a/crates/openhuman-embed/src/runtime/live_hooks.rs+++ b/crates/openhuman-embed/src/runtime/live_hooks.rs@@ -1,7 +1,7 @@//! Tracked runtime hooks, composed with agent-local hooks.use super::Runtime;use crate::seams::{- LearningSink, OpenHumanRunContext, ToolHook, ToolHookContext, ToolHookDecision, TurnSummary,+ OpenHumanRunContext, ToolHook, ToolHookContext, ToolHookDecision,};use std::sync::Arc;diff --git a/crates/openhuman-embed/tests/tool_hook_context.rs b/crates/openhuman-embed/tests/tool_hook_context.rsindex 30fdcabc01..ef98a95b43 100644--- a/crates/openhuman-embed/tests/tool_hook_context.rs+++ b/crates/openhuman-embed/tests/tool_hook_context.rs@@ -6,7 +6,7 @@ use common::{chat_completion, offline_config, route, runtime, scripted_provider, stub_backend,tool_call_completion,};-use openhuman_embed::seams::{ToolHook, ToolHookContext};+use openhuman_embed::seams::{OpenHumanRunContext, ToolHook, ToolHookContext};use openhuman_embed::{Access, AgentDefinitionSpec, AgentSpec, Runtime, ToolScopeSpec, Workspace};use serde_json::{json, Value};use std::sync::{Arc, Mutex};@@ -17,11 +17,19 @@ impl ToolHook<OpenHumanRunContext> for Capture {fn name(&self) -> &str {"context-probe"}- async fn before_tool(&self, ctx: &ToolHookContext) -> anyhow::Result<()> {+ async fn before_tool(+ &self,+ _: &OpenHumanRunContext,+ ctx: &ToolHookContext,+ ) -> anyhow::Result<()> {self.0.lock().unwrap().push(serde_json::to_value(ctx)?);Ok(())}- async fn after_tool(&self, ctx: &ToolHookContext) -> anyhow::Result<()> {+ async fn after_tool(+ &self,+ _: &OpenHumanRunContext,+ ctx: &ToolHookContext,+ ) -> anyhow::Result<()> {self.0.lock().unwrap().push(serde_json::to_value(ctx)?);Ok(())}