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
style: format schema tests and drop unused imports
Steven Enamakela4c798e3542a
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/steer_subagent.rs b/crates/openhuman-core/src/agent/orchestration/tools/steer_subagent.rsindex a4e53db3f1..bfc2ff38d5 100644--- a/crates/openhuman-core/src/agent/orchestration/tools/steer_subagent.rs+++ b/crates/openhuman-core/src/agent/orchestration/tools/steer_subagent.rs@@ -7,11 +7,10 @@//! redirect or feed data to a running sub-agent//! without waiting for it to finish or restarting it. Mirrors Codex `send_input`.-use crate::tools::schema_cache::static_schema;use crate::agent::harness::fork_context::ParentExecutionContext;use crate::agent::orchestration::running_subagents::{self, SteerError};+use crate::tools::schema_cache::static_schema;use async_trait::async_trait;-use serde_json::json;use std::sync::Arc;use tinyagents_harness::context::RunContext;use tinyagents_harness::run_queue::QueueLane;diff --git a/crates/openhuman-core/src/agent/orchestration/tools/steer_subagent_schema_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/steer_subagent_schema_tests.rsindex f24ae3ada6..0058399198 100644--- a/crates/openhuman-core/src/agent/orchestration/tools/steer_subagent_schema_tests.rs+++ b/crates/openhuman-core/src/agent/orchestration/tools/steer_subagent_schema_tests.rs@@ -3,33 +3,36 @@ use serde_json::json;fn expected_steer_subagent() -> serde_json::Value {json!({- "type": "object",- "required": ["message"],- "properties": {- "task_id": {- "type": "string",- "description": "Transient task_id returned by reusable async delegation."- },- "subagent_session_id": {- "type": "string",- "description": "Durable subagent_session_id returned by reusable async delegation. Preferred over task_id for cross-turn messaging."- },- "message": {- "type": "string",- "description": "Instruction or data to inject into the running sub-agent."- },- "mode": {- "type": "string",- "enum": ["steer", "collect"],- "default": "steer",- "description": "steer = a new instruction the sub-agent must address; collect = silent additional context."- }+ "type": "object",+ "required": ["message"],+ "properties": {+ "task_id": {+ "type": "string",+ "description": "Transient task_id returned by reusable async delegation."+ },+ "subagent_session_id": {+ "type": "string",+ "description": "Durable subagent_session_id returned by reusable async delegation. Preferred over task_id for cross-turn messaging."+ },+ "message": {+ "type": "string",+ "description": "Instruction or data to inject into the running sub-agent."+ },+ "mode": {+ "type": "string",+ "enum": ["steer", "collect"],+ "default": "steer",+ "description": "steer = a new instruction the sub-agent must address; collect = silent additional context."}- })+ }+ })}#[test]fn steer_subagent_static_schema_matches_json_literal() {let tool = SteerSubagentTool;- assert_eq!(tinytools::Tool::parameters_schema(&tool), expected_steer_subagent());+ assert_eq!(+ tinytools::Tool::parameters_schema(&tool),+ expected_steer_subagent()+ );}diff --git a/crates/openhuman-core/src/agent/orchestration/tools/steer_subagent_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/steer_subagent_tests.rsindex bbb7ce8051..155775cd46 100644--- a/crates/openhuman-core/src/agent/orchestration/tools/steer_subagent_tests.rs+++ b/crates/openhuman-core/src/agent/orchestration/tools/steer_subagent_tests.rs@@ -1,4 +1,5 @@use super::*;+use serde_json::json;#[test]fn schema_requires_task_id_and_message() {diff --git a/crates/openhuman-core/src/flows/builder_tools/draft_revise.rs b/crates/openhuman-core/src/flows/builder_tools/draft_revise.rsindex b7f35e82a2..2263a1a723 100644--- a/crates/openhuman-core/src/flows/builder_tools/draft_revise.rs+++ b/crates/openhuman-core/src/flows/builder_tools/draft_revise.rs@@ -4,7 +4,7 @@ use crate::tools::schema_cache::static_schema;use std::sync::Arc;use async_trait::async_trait;-use serde_json::{json, Value};+use serde_json::Value;use crate::config::Config;use crate::flows::ops;diff --git a/crates/openhuman-core/src/flows/builder_tools/draft_revise_schema_tests.rs b/crates/openhuman-core/src/flows/builder_tools/draft_revise_schema_tests.rsindex 5dc225c781..398949f3e4 100644--- a/crates/openhuman-core/src/flows/builder_tools/draft_revise_schema_tests.rs+++ b/crates/openhuman-core/src/flows/builder_tools/draft_revise_schema_tests.rs@@ -3,36 +3,39 @@ use serde_json::json;fn expected_revise_workflow() -> serde_json::Value {json!({- "type": "object",- "properties": {- "name": {- "type": "string",- "description": "Human-readable name for the (revised) proposed flow."- },- "graph": {- "type": "object",- "description": "The full REVISED tinyflows WorkflowGraph: { name?, nodes: [...], edges: [...] }. Apply your changes to the prior draft and pass the whole graph — see propose_workflow for node kinds and config shapes.",- "properties": {- "nodes": { "type": "array" },- "edges": { "type": "array" }- },- "required": ["nodes", "edges"]- },- "instruction": {- "type": "string",- "description": "The revision instruction that motivated this change (e.g. 'add a Slack step after the summary'). Echoed back for the review card; does not affect validation."+ "type": "object",+ "properties": {+ "name": {+ "type": "string",+ "description": "Human-readable name for the (revised) proposed flow."+ },+ "graph": {+ "type": "object",+ "description": "The full REVISED tinyflows WorkflowGraph: { name?, nodes: [...], edges: [...] }. Apply your changes to the prior draft and pass the whole graph — see propose_workflow for node kinds and config shapes.",+ "properties": {+ "nodes": { "type": "array" },+ "edges": { "type": "array" }},- "require_approval": {- "type": "boolean",- "description": "Force a human-approval gate on every outbound action once saved. Defaults to true for agent-proposed flows."- }+ "required": ["nodes", "edges"]+ },+ "instruction": {+ "type": "string",+ "description": "The revision instruction that motivated this change (e.g. 'add a Slack step after the summary'). Echoed back for the review card; does not affect validation."},- "required": ["name", "graph"]- })+ "require_approval": {+ "type": "boolean",+ "description": "Force a human-approval gate on every outbound action once saved. Defaults to true for agent-proposed flows."+ }+ },+ "required": ["name", "graph"]+ })}#[test]fn revise_workflow_static_schema_matches_json_literal() {let tool = ReviseWorkflowTool::new(std::sync::Arc::new(crate::config::Config::default()));- assert_eq!(tinytools::Tool::parameters_schema(&tool), expected_revise_workflow());+ assert_eq!(+ tinytools::Tool::parameters_schema(&tool),+ expected_revise_workflow()+ );}diff --git a/crates/openhuman-core/src/integrations/composio/tools/list_tools.rs b/crates/openhuman-core/src/integrations/composio/tools/list_tools.rsindex 9142b0fece..b785380339 100644--- a/crates/openhuman-core/src/integrations/composio/tools/list_tools.rs+++ b/crates/openhuman-core/src/integrations/composio/tools/list_tools.rs@@ -5,7 +5,7 @@ use std::collections::HashSet;use std::sync::Arc;use async_trait::async_trait;-use serde_json::{json, Value};+use serde_json::Value;use super::live_config::live_composio_config;use super::redact::redact_composio_outcome;diff --git a/crates/openhuman-core/src/integrations/composio/tools/list_tools_schema_tests.rs b/crates/openhuman-core/src/integrations/composio/tools/list_tools_schema_tests.rsindex 07283fcc31..b85197b950 100644--- a/crates/openhuman-core/src/integrations/composio/tools/list_tools_schema_tests.rs+++ b/crates/openhuman-core/src/integrations/composio/tools/list_tools_schema_tests.rs@@ -3,34 +3,37 @@ use serde_json::json;fn expected_composio_list_tools() -> serde_json::Value {json!({- "type": "object",- "properties": {- "toolkits": {- "type": "array",- "items": { "type": "string" },- "description": "Optional list of toolkit slugs to filter by."- },- "tags": {- "type": "array",- "items": { "type": "string" },- "description": "Optional Composio action tags to filter by \- (OR semantics — multiple tags broaden the result, \- e.g. [\"readOnlyHint\"] or [\"repos\", \"stars\"]). \- Case-insensitive."- },- "include_unconnected": {- "type": "boolean",- "description": "When true, include actions from toolkits the user \- has not connected yet. Defaults to false (only \- connected toolkits)."- }+ "type": "object",+ "properties": {+ "toolkits": {+ "type": "array",+ "items": { "type": "string" },+ "description": "Optional list of toolkit slugs to filter by."},- "additionalProperties": false- })+ "tags": {+ "type": "array",+ "items": { "type": "string" },+ "description": "Optional Composio action tags to filter by \+ (OR semantics — multiple tags broaden the result, \+ e.g. [\"readOnlyHint\"] or [\"repos\", \"stars\"]). \+ Case-insensitive."+ },+ "include_unconnected": {+ "type": "boolean",+ "description": "When true, include actions from toolkits the user \+ has not connected yet. Defaults to false (only \+ connected toolkits)."+ }+ },+ "additionalProperties": false+ })}#[test]fn composio_list_tools_static_schema_matches_json_literal() {let tool = ComposioListToolsTool::new(std::sync::Arc::new(crate::config::Config::default()));- assert_eq!(tinytools::Tool::parameters_schema(&tool), expected_composio_list_tools());+ assert_eq!(+ tinytools::Tool::parameters_schema(&tool),+ expected_composio_list_tools()+ );}diff --git a/crates/openhuman-core/src/tools/impl/system/node_exec.rs b/crates/openhuman-core/src/tools/impl/system/node_exec.rsindex 07666222a5..76b647388c 100644--- a/crates/openhuman-core/src/tools/impl/system/node_exec.rs+++ b/crates/openhuman-core/src/tools/impl/system/node_exec.rs@@ -21,12 +21,11 @@//! extract a managed Node.js distribution if no compatible `node` is on//! `PATH`. Subsequent calls reuse the cached install.-use crate::tools::schema_cache::static_schema;use crate::agent::host_runtime::RuntimeAdapter;use crate::runtime::javascript::NodeBootstrap;use crate::security::{CommandClass, GateDecision, SecurityPolicy};+use crate::tools::schema_cache::static_schema;use async_trait::async_trait;-use serde_json::json;use std::sync::Arc;use std::time::Duration;use tinytools::ToolRunContext;diff --git a/crates/openhuman-core/src/tools/impl/system/node_exec_schema_tests.rs b/crates/openhuman-core/src/tools/impl/system/node_exec_schema_tests.rsindex 0a11d2e6da..a25d97d488 100644--- a/crates/openhuman-core/src/tools/impl/system/node_exec_schema_tests.rs+++ b/crates/openhuman-core/src/tools/impl/system/node_exec_schema_tests.rs@@ -3,31 +3,42 @@ use serde_json::json;fn expected_node_exec() -> serde_json::Value {json!({- "type": "object",- "properties": {- "inline_code": {- "type": "string",- "description": "JavaScript source passed to `node -e`. Mutually exclusive with script_path."- },- "script_path": {- "type": "string",- "description": "Path (relative to workspace) to a .js/.mjs/.cjs file. Mutually exclusive with inline_code."- },- "args": {- "type": "array",- "items": { "type": "string" },- "description": "Positional arguments appended after the script. Ignored for inline_code."- },- "timeout_secs": {- "type": "integer",- "description": "Optional wall-clock timeout (seconds) before the process is killed. No timeout by default — long-running scripts run to completion. Capped at 1800s; 0 disables."- }+ "type": "object",+ "properties": {+ "inline_code": {+ "type": "string",+ "description": "JavaScript source passed to `node -e`. Mutually exclusive with script_path."+ },+ "script_path": {+ "type": "string",+ "description": "Path (relative to workspace) to a .js/.mjs/.cjs file. Mutually exclusive with inline_code."+ },+ "args": {+ "type": "array",+ "items": { "type": "string" },+ "description": "Positional arguments appended after the script. Ignored for inline_code."+ },+ "timeout_secs": {+ "type": "integer",+ "description": "Optional wall-clock timeout (seconds) before the process is killed. No timeout by default — long-running scripts run to completion. Capped at 1800s; 0 disables."}- })+ }+ })}#[test]fn node_exec_static_schema_matches_json_literal() {- let tool = NodeExecTool::new(std::sync::Arc::new(crate::security::SecurityPolicy::default()), std::sync::Arc::new(crate::agent::host_runtime::NativeRuntime::new()), std::sync::Arc::new(NodeBootstrap::new(std::sync::Arc::new(crate::config::Config::default()))), crate::config::RuntimePoolConfig::default(), std::path::PathBuf::from("."));- assert_eq!(tinytools::Tool::parameters_schema(&tool), expected_node_exec());+ let tool = NodeExecTool::new(+ std::sync::Arc::new(crate::security::SecurityPolicy::default()),+ std::sync::Arc::new(crate::agent::host_runtime::NativeRuntime::new()),+ std::sync::Arc::new(NodeBootstrap::new(std::sync::Arc::new(+ crate::config::Config::default(),+ ))),+ crate::config::RuntimePoolConfig::default(),+ std::path::PathBuf::from("."),+ );+ assert_eq!(+ tinytools::Tool::parameters_schema(&tool),+ expected_node_exec()+ );}diff --git a/crates/openhuman-core/src/tools/impl/system/node_exec_tests.rs b/crates/openhuman-core/src/tools/impl/system/node_exec_tests.rsindex 9615701f33..a10667de87 100644--- a/crates/openhuman-core/src/tools/impl/system/node_exec_tests.rs+++ b/crates/openhuman-core/src/tools/impl/system/node_exec_tests.rs@@ -1,4 +1,5 @@use super::*;+use serde_json::json;fn absolute_sample() -> &'static str {if cfg!(windows) {"C:\\Windows\\System32\\drivers\\etc\\hosts"diff --git a/crates/openhuman-core/src/tools/impl/system/npm_exec.rs b/crates/openhuman-core/src/tools/impl/system/npm_exec.rsindex 6bcce41919..f542aab6a5 100644--- a/crates/openhuman-core/src/tools/impl/system/npm_exec.rs+++ b/crates/openhuman-core/src/tools/impl/system/npm_exec.rs@@ -17,12 +17,11 @@//! metacharacters (guarded server-side). Free-form args go through//! POSIX-safe single-quoting.-use crate::tools::schema_cache::static_schema;use crate::agent::host_runtime::RuntimeAdapter;use crate::runtime::javascript::NodeBootstrap;use crate::security::{CommandClass, GateDecision, SecurityPolicy};+use crate::tools::schema_cache::static_schema;use async_trait::async_trait;-use serde_json::json;use std::sync::Arc;use std::time::Duration;use tinytools::ToolRunContext;diff --git a/crates/openhuman-core/src/tools/impl/system/npm_exec_schema_tests.rs b/crates/openhuman-core/src/tools/impl/system/npm_exec_schema_tests.rsindex a3f197584f..09811b862a 100644--- a/crates/openhuman-core/src/tools/impl/system/npm_exec_schema_tests.rs+++ b/crates/openhuman-core/src/tools/impl/system/npm_exec_schema_tests.rs@@ -3,32 +3,41 @@ use serde_json::json;fn expected_npm_exec() -> serde_json::Value {json!({- "type": "object",- "properties": {- "subcommand": {- "type": "string",- "description": "npm subcommand, e.g. `install`, `ci`, `run`, `test`, `exec`."- },- "args": {- "type": "array",- "items": { "type": "string" },- "description": "Arguments appended after the subcommand (e.g. [\"build\"] for `npm run build`)."- },- "cwd": {- "type": "string",- "description": "Optional sub-directory (relative to workspace) to run npm in. Defaults to the workspace root."- },- "timeout_secs": {- "type": "integer",- "description": "Optional wall-clock timeout (seconds) before npm is killed. No timeout by default — installs/builds run to completion. Capped at 1800s; 0 disables."- }+ "type": "object",+ "properties": {+ "subcommand": {+ "type": "string",+ "description": "npm subcommand, e.g. `install`, `ci`, `run`, `test`, `exec`."},- "required": ["subcommand"]- })+ "args": {+ "type": "array",+ "items": { "type": "string" },+ "description": "Arguments appended after the subcommand (e.g. [\"build\"] for `npm run build`)."+ },+ "cwd": {+ "type": "string",+ "description": "Optional sub-directory (relative to workspace) to run npm in. Defaults to the workspace root."+ },+ "timeout_secs": {+ "type": "integer",+ "description": "Optional wall-clock timeout (seconds) before npm is killed. No timeout by default — installs/builds run to completion. Capped at 1800s; 0 disables."+ }+ },+ "required": ["subcommand"]+ })}#[test]fn npm_exec_static_schema_matches_json_literal() {- let tool = NpmExecTool::new(std::sync::Arc::new(crate::security::SecurityPolicy::default()), std::sync::Arc::new(crate::agent::host_runtime::NativeRuntime::new()), std::sync::Arc::new(NodeBootstrap::new(std::sync::Arc::new(crate::config::Config::default()))));- assert_eq!(tinytools::Tool::parameters_schema(&tool), expected_npm_exec());+ let tool = NpmExecTool::new(+ std::sync::Arc::new(crate::security::SecurityPolicy::default()),+ std::sync::Arc::new(crate::agent::host_runtime::NativeRuntime::new()),+ std::sync::Arc::new(NodeBootstrap::new(std::sync::Arc::new(+ crate::config::Config::default(),+ ))),+ );+ assert_eq!(+ tinytools::Tool::parameters_schema(&tool),+ expected_npm_exec()+ );}diff --git a/crates/openhuman-core/src/tools/impl/system/npm_exec_tests.rs b/crates/openhuman-core/src/tools/impl/system/npm_exec_tests.rsindex 059e42a84e..64c24dff35 100644--- a/crates/openhuman-core/src/tools/impl/system/npm_exec_tests.rs+++ b/crates/openhuman-core/src/tools/impl/system/npm_exec_tests.rs@@ -1,4 +1,5 @@use super::*;+use serde_json::json;fn absolute_sample() -> &'static str {if cfg!(windows) {"C:\\Windows\\System32"