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(agent): wire up live tool and harness test modules
Steven Enamakel0596bbbea81f
diff --git a/crates/openhuman-core/src/agent/session_host/live_tools.rs b/crates/openhuman-core/src/agent/session_host/live_tools.rsindex 2a786e57d0..7a6588e23d 100644--- a/crates/openhuman-core/src/agent/session_host/live_tools.rs+++ b/crates/openhuman-core/src/agent/session_host/live_tools.rs@@ -42,3 +42,7 @@ impl OpenHumanSessionHost {self.workspace_descriptor.clone()}}++#[cfg(test)]+#[path = "live_tools_tests.rs"]+mod tests;diff --git a/crates/openhuman-core/src/agent/session_host/live_tools_tests.rs b/crates/openhuman-core/src/agent/session_host/live_tools_tests.rsnew file mode 100644index 0000000000..29d22fa79a--- /dev/null+++ b/crates/openhuman-core/src/agent/session_host/live_tools_tests.rs@@ -0,0 +1,24 @@+use super::*;++#[test]+fn exposes_durable_visible_tools_and_policy() {+ let root = tempfile::tempdir().unwrap();+ let model = Arc::new(tinyagents_harness::testkit::ScriptedModel::replies(vec!["ok"]));+ let chat_model: Arc<dyn tinyinference_llm::model::ChatModel<()>> = model;+ let mut host = crate::agent::SessionHostBuilder::new()+ .chat_model(chat_model)+ .tools(Vec::new())+ .workspace_dir(root.path().join("workspace"))+ .action_dir(root.path().to_path_buf())+ .tool_dispatcher(Box::new(tinytools_agent::dialect::NativeDialect))+ .build()+ .expect("session build");+ let surface = host.live_tool_surface();+ assert_eq!(surface.tool_sets.len(), 1);+ assert!(surface.allowed.is_empty());+ assert!(surface.tool_policy.is_some());+ assert!(!surface.has_thread);+ host.set_thread_id(Some("t1"));+ assert!(host.live_tool_surface().has_thread);+ let _ = host.live_workspace_descriptor();+}diff --git a/crates/openhuman-core/src/agent/tinyagents/live_harness.rs b/crates/openhuman-core/src/agent/tinyagents/live_harness.rsindex 6e2c93b026..b9939f016a 100644--- a/crates/openhuman-core/src/agent/tinyagents/live_harness.rs+++ b/crates/openhuman-core/src/agent/tinyagents/live_harness.rs@@ -128,3 +128,7 @@ pub(crate) fn assemble_live_tool_harness(}harness}++#[cfg(test)]+#[path = "live_harness_tests.rs"]+mod tests;diff --git a/crates/openhuman-core/src/agent/tinyagents/live_harness_tests.rs b/crates/openhuman-core/src/agent/tinyagents/live_harness_tests.rsnew file mode 100644index 0000000000..98e778da8a--- /dev/null+++ b/crates/openhuman-core/src/agent/tinyagents/live_harness_tests.rs@@ -0,0 +1,87 @@+use super::*;+use async_trait::async_trait;+use tinytools::{Tool, ToolResult};++struct NamedTool(&'static str);++#[async_trait]+impl Tool for NamedTool {+ fn name(&self) -> &str {+ self.0+ }++ fn description(&self) -> &str {+ "test tool"+ }++ fn parameters_schema(&self) -> serde_json::Value {+ serde_json::json!({"type": "object"})+ }++ async fn execute(&self, _args: serde_json::Value) -> anyhow::Result<ToolResult> {+ Ok(ToolResult::success("ok"))+ }+}++fn surface(allowed: &[&str]) -> LiveToolSurface {+ let tools: Vec<Box<dyn tinytools::Tool>> =+ vec![Box::new(NamedTool("alpha")), Box::new(NamedTool("beta"))];+ LiveToolSurface {+ tool_sets: vec![Arc::new(tools)],+ allowed: allowed.iter().map(|s| (*s).to_string()).collect(),+ tool_policy: None,+ has_thread: true,+ }+}++#[test]+fn registers_only_allowed_tools() {+ let harness = assemble_live_tool_harness(surface(&["alpha"]));+ let names: Vec<_> = harness+ .tools()+ .schemas()+ .into_iter()+ .map(|schema| schema.name)+ .collect();+ assert_eq!(names, vec!["alpha"]);+}++#[test]+fn installs_the_tool_boundary_middleware() {+ let harness = assemble_live_tool_harness(surface(&["alpha", "beta"]));+ assert_eq!(harness.tools().schemas().len(), 2);+ // Approval, CLI/RPC-only and credential scrubbing wrap every call.+ assert!(harness.middleware().tool_middleware_len() >= 3);+ assert!(harness.middleware().len() >= 3);+}++#[tokio::test]+async fn runs_an_allowed_call_through_the_pipeline() {+ use tinyagents_harness::agent_loop::phases::execute_tool_batch;+ let harness = assemble_live_tool_harness(surface(&["alpha"]));+ let mut ctx = OpenHumanRunContext::new()+ .into_tinyagents(tinyagents_harness::context::RunConfig::new("live-harness-test"));+ let mut run = tinyagents_harness::middleware::AgentRun::new();+ let mut status = tinyagents_harness::events::HarnessRunStatus::new(+ ctx.run_id().clone(),+ tinyagents_harness::ComponentId::new("test".to_string()),+ );+ let mut messages = Vec::new();+ let outcome = execute_tool_batch(+ &harness,+ &(),+ &mut ctx,+ &mut run,+ &mut status,+ &mut messages,+ vec![tinyinference_llm::tool::ToolCall::new(+ "c1",+ "alpha",+ serde_json::json!({}),+ )],+ )+ .await+ .expect("batch runs");+ assert_eq!(outcome.results.len(), 1);+ assert!(outcome.results[0].text().contains("ok"));+}