Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

refactor(tools): migrate tool contexts to tinytools

Steven Enamakel08dc84cb648d
diff --git a/src/openhuman/agent/orchestration/tools/agent_prepare_context.rs b/src/openhuman/agent/orchestration/tools/agent_prepare_context.rs
index 9899764304..baf83facbf 100644
--- a/src/openhuman/agent/orchestration/tools/agent_prepare_context.rs
+++ b/src/openhuman/agent/orchestration/tools/agent_prepare_context.rs
@@ -27,6 +27,7 @@ use async_trait::async_trait;
use serde_json::json;
use std::fmt::Write as _;
use tinyagents::harness::tool::ToolExecutionContext;
+use tinytools::ToolRunContext;
use tinyagents::harness::workspace::WorkspaceDescriptor;
/// The sub-agent archetype this tool drives.
diff --git a/src/openhuman/agent/orchestration/tools/archetype_delegation.rs b/src/openhuman/agent/orchestration/tools/archetype_delegation.rs
index fff3e58fd7..e4f358d455 100644
--- a/src/openhuman/agent/orchestration/tools/archetype_delegation.rs
+++ b/src/openhuman/agent/orchestration/tools/archetype_delegation.rs
@@ -5,7 +5,7 @@ use serde_json::Value;
use crate::openhuman::tools::traits::{
PermissionLevel, Tool, ToolCallOptions, ToolCategory, ToolResult, ToolTimeout,
};
-use tinyagents::harness::tool::ToolExecutionContext;
+use tinytools::ToolRunContext;
pub struct ArchetypeDelegationTool {
pub tool_name: String,
diff --git a/src/openhuman/agent/orchestration/tools/continue_subagent.rs b/src/openhuman/agent/orchestration/tools/continue_subagent.rs
index 8d7da0227b..02314efbe7 100644
--- a/src/openhuman/agent/orchestration/tools/continue_subagent.rs
+++ b/src/openhuman/agent/orchestration/tools/continue_subagent.rs
@@ -19,6 +19,7 @@ use crate::openhuman::tools::traits::{PermissionLevel, Tool, ToolCallOptions, To
use async_trait::async_trait;
use serde_json::json;
use tinyagents::harness::tool::ToolExecutionContext;
+use tinytools::ToolRunContext;
pub struct ContinueSubagentTool;
diff --git a/src/openhuman/agent/orchestration/tools/delegate_graph.rs b/src/openhuman/agent/orchestration/tools/delegate_graph.rs
index 3fd13dd251..b94f74624e 100644
--- a/src/openhuman/agent/orchestration/tools/delegate_graph.rs
+++ b/src/openhuman/agent/orchestration/tools/delegate_graph.rs
@@ -17,7 +17,7 @@ use crate::openhuman::tools::traits::{PermissionLevel, Tool, ToolCallOptions, To
use async_trait::async_trait;
use serde_json::json;
use std::sync::Arc;
-use tinyagents::harness::tool::ToolExecutionContext;
+use tinytools::ToolRunContext;
/// Default reviewer-requested revision budget when the caller omits it.
const DEFAULT_MAX_REVISIONS: usize = 2;
diff --git a/src/openhuman/agent/orchestration/tools/dispatch.rs b/src/openhuman/agent/orchestration/tools/dispatch.rs
index 4f0d337786..52e3bdec80 100644
--- a/src/openhuman/agent/orchestration/tools/dispatch.rs
+++ b/src/openhuman/agent/orchestration/tools/dispatch.rs
@@ -8,6 +8,7 @@ use crate::openhuman::agent::harness::subagent_runner::{
use crate::openhuman::agent::progress::AgentProgress;
use crate::openhuman::tools::traits::{Tool as _, ToolCallOptions, ToolResult};
use tinyagents::harness::tool::ToolExecutionContext;
+use tinytools::ToolRunContext;
/// How a delegated sub-agent run should be scheduled relative to the parent
/// turn.
diff --git a/src/openhuman/agent/orchestration/tools/skill_delegation.rs b/src/openhuman/agent/orchestration/tools/skill_delegation.rs
index 089a2f801a..df2a69be56 100644
--- a/src/openhuman/agent/orchestration/tools/skill_delegation.rs
+++ b/src/openhuman/agent/orchestration/tools/skill_delegation.rs
@@ -23,7 +23,7 @@ use crate::openhuman::tools::orchestrator_tools::sanitise_slug;
use crate::openhuman::tools::traits::{
PermissionLevel, Tool, ToolCallOptions, ToolCategory, ToolResult,
};
-use tinyagents::harness::tool::ToolExecutionContext;
+use tinytools::ToolRunContext;
/// Canonical tool name surfaced to the orchestrator LLM.
pub const INTEGRATIONS_DELEGATE_TOOL_NAME: &str = "delegate_to_integrations_agent";
diff --git a/src/openhuman/agent/orchestration/tools/spawn_async_subagent.rs b/src/openhuman/agent/orchestration/tools/spawn_async_subagent.rs
index 1acbdeb6c1..0e161f5147 100644
--- a/src/openhuman/agent/orchestration/tools/spawn_async_subagent.rs
+++ b/src/openhuman/agent/orchestration/tools/spawn_async_subagent.rs
@@ -21,6 +21,7 @@ use crate::openhuman::tools::traits::{PermissionLevel, Tool, ToolCallOptions, To
use async_trait::async_trait;
use serde_json::json;
use tinyagents::harness::tool::ToolExecutionContext;
+use tinytools::ToolRunContext;
use tinycortex::memory::conversations::{self as conversations, ConversationMessage};
pub struct SpawnAsyncSubagentTool;
diff --git a/src/openhuman/agent/orchestration/tools/spawn_parallel_agents.rs b/src/openhuman/agent/orchestration/tools/spawn_parallel_agents.rs
index c523ec740a..e9f1b17c8a 100644
--- a/src/openhuman/agent/orchestration/tools/spawn_parallel_agents.rs
+++ b/src/openhuman/agent/orchestration/tools/spawn_parallel_agents.rs
@@ -19,7 +19,7 @@ use crate::openhuman::tools::traits::{
};
use async_trait::async_trait;
use serde_json::json;
-use tinyagents::harness::tool::ToolExecutionContext;
+use tinytools::ToolRunContext;
pub struct SpawnParallelAgentsTool;
diff --git a/src/openhuman/agent/orchestration/tools/spawn_subagent.rs b/src/openhuman/agent/orchestration/tools/spawn_subagent.rs
index c6f2406a05..92edf98baa 100644
--- a/src/openhuman/agent/orchestration/tools/spawn_subagent.rs
+++ b/src/openhuman/agent/orchestration/tools/spawn_subagent.rs
@@ -23,6 +23,7 @@ use async_trait::async_trait;
use serde_json::json;
use std::path::PathBuf;
use tinyagents::harness::tool::ToolExecutionContext;
+use tinytools::ToolRunContext;
use tinycortex::memory::conversations::{
self as conversations, ConversationMessage, CreateConversationThread,
};
diff --git a/src/openhuman/agent/orchestration/tools/spawn_worker_thread.rs b/src/openhuman/agent/orchestration/tools/spawn_worker_thread.rs
index 230767dd15..071c7e9488 100644
--- a/src/openhuman/agent/orchestration/tools/spawn_worker_thread.rs
+++ b/src/openhuman/agent/orchestration/tools/spawn_worker_thread.rs
@@ -16,6 +16,7 @@ use crate::openhuman::tools::traits::{PermissionLevel, Tool, ToolCallOptions, To
use async_trait::async_trait;
use serde_json::json;
use tinyagents::harness::tool::ToolExecutionContext;
+use tinytools::ToolRunContext;
use tinycortex::memory::conversations;
/// Spawns a sub-agent in a dedicated worker thread.
diff --git a/src/openhuman/agent/tools/delegate_to_personality.rs b/src/openhuman/agent/tools/delegate_to_personality.rs
index 074e93a7b5..bfca6fc1f6 100644
--- a/src/openhuman/agent/tools/delegate_to_personality.rs
+++ b/src/openhuman/agent/tools/delegate_to_personality.rs
@@ -9,6 +9,7 @@ use crate::openhuman::tools::traits::{PermissionLevel, Tool, ToolCallOptions, To
use async_trait::async_trait;
use serde_json::json;
use tinyagents::harness::tool::ToolExecutionContext;
+use tinytools::ToolRunContext;
pub struct DelegateToPersonalityTool;
diff --git a/src/openhuman/integrations/file_storage/tools.rs b/src/openhuman/integrations/file_storage/tools.rs
index 45af9edf3d..c72fd5be12 100644
--- a/src/openhuman/integrations/file_storage/tools.rs
+++ b/src/openhuman/integrations/file_storage/tools.rs
@@ -27,6 +27,7 @@ use crate::openhuman::tools::traits::{
PermissionLevel, Tool, ToolCallOptions, ToolCategory, ToolResult,
};
use tinyagents::harness::tool::ToolExecutionContext;
+use tinytools::ToolRunContext;
use super::types::{DeleteResponse, FileMeta, LinkResponse, ListFilesResponse, UploadResponse};
diff --git a/src/openhuman/media/generation/tools.rs b/src/openhuman/media/generation/tools.rs
index f0dd5dcdc0..755bc43cd6 100644
--- a/src/openhuman/media/generation/tools.rs
+++ b/src/openhuman/media/generation/tools.rs
@@ -28,6 +28,7 @@ use crate::openhuman::tools::traits::{
PermissionLevel, Tool, ToolCallOptions, ToolCategory, ToolResult,
};
use tinyagents::harness::tool::ToolExecutionContext;
+use tinytools::ToolRunContext;
use super::download::persist_media;
use super::types::MediaResponse;
diff --git a/src/openhuman/memory/agent/tools.rs b/src/openhuman/memory/agent/tools.rs
index c9040585c1..8db85dc578 100644
--- a/src/openhuman/memory/agent/tools.rs
+++ b/src/openhuman/memory/agent/tools.rs
@@ -20,6 +20,7 @@ use crate::openhuman::tools::traits::{
use async_trait::async_trait;
use serde_json::json;
use tinyagents::harness::tool::ToolExecutionContext;
+use tinytools::ToolRunContext;
const AGENT_ID: &str = "agent_memory";
diff --git a/src/openhuman/tools/impl/filesystem/apply_patch.rs b/src/openhuman/tools/impl/filesystem/apply_patch.rs
index 1fbfdc1d2b..0ce3cd79e1 100644
--- a/src/openhuman/tools/impl/filesystem/apply_patch.rs
+++ b/src/openhuman/tools/impl/filesystem/apply_patch.rs
@@ -14,7 +14,7 @@ use serde_json::json;
use std::collections::HashMap;
use std::path::PathBuf;
use std::sync::Arc;
-use tinyagents::harness::tool::ToolExecutionContext;
+use tinytools::ToolRunContext;
const MAX_FILE_BYTES: u64 = 5 * 1024 * 1024;
const MAX_EDITS: usize = 50;
diff --git a/src/openhuman/tools/impl/filesystem/csv_export.rs b/src/openhuman/tools/impl/filesystem/csv_export.rs
index 0deaa8cb71..07def7dec7 100644
--- a/src/openhuman/tools/impl/filesystem/csv_export.rs
+++ b/src/openhuman/tools/impl/filesystem/csv_export.rs
@@ -3,7 +3,7 @@ use crate::openhuman::tools::traits::{Tool, ToolCallOptions, ToolResult};
use async_trait::async_trait;
use serde_json::json;
use std::sync::Arc;
-use tinyagents::harness::tool::ToolExecutionContext;
+use tinytools::ToolRunContext;
/// Export structured data (JSON array of objects) as a CSV file to the workspace.
pub struct CsvExportTool {
diff --git a/src/openhuman/tools/impl/filesystem/edit_file.rs b/src/openhuman/tools/impl/filesystem/edit_file.rs
index 7efd5e0eb1..62ead59655 100644
--- a/src/openhuman/tools/impl/filesystem/edit_file.rs
+++ b/src/openhuman/tools/impl/filesystem/edit_file.rs
@@ -12,7 +12,7 @@ use crate::openhuman::tools::traits::{PermissionLevel, Tool, ToolCallOptions, To
use async_trait::async_trait;
use serde_json::json;
use std::sync::Arc;
-use tinyagents::harness::tool::ToolExecutionContext;
+use tinytools::ToolRunContext;
const MAX_FILE_BYTES: u64 = 5 * 1024 * 1024;
diff --git a/src/openhuman/tools/impl/filesystem/file_read.rs b/src/openhuman/tools/impl/filesystem/file_read.rs
index fe13a6e2c1..2c12513530 100644
--- a/src/openhuman/tools/impl/filesystem/file_read.rs
+++ b/src/openhuman/tools/impl/filesystem/file_read.rs
@@ -4,7 +4,7 @@ use crate::openhuman::tools::traits::{Tool, ToolCallOptions, ToolResult};
use async_trait::async_trait;
use serde_json::json;
use std::sync::Arc;
-use tinyagents::harness::tool::ToolExecutionContext;
+use tinytools::ToolRunContext;
const MAX_FILE_SIZE_BYTES: u64 = 10 * 1024 * 1024;
diff --git a/src/openhuman/tools/impl/filesystem/file_write.rs b/src/openhuman/tools/impl/filesystem/file_write.rs
index 9cfc0bc385..cfd1e46808 100644
--- a/src/openhuman/tools/impl/filesystem/file_write.rs
+++ b/src/openhuman/tools/impl/filesystem/file_write.rs
@@ -4,7 +4,7 @@ use crate::openhuman::tools::traits::{PermissionLevel, Tool, ToolCallOptions, To
use async_trait::async_trait;
use serde_json::json;
use std::sync::Arc;
-use tinyagents::harness::tool::ToolExecutionContext;
+use tinytools::ToolRunContext;
/// Write file contents with path sandboxing
pub struct FileWriteTool {
diff --git a/src/openhuman/tools/impl/filesystem/git_operations.rs b/src/openhuman/tools/impl/filesystem/git_operations.rs
index 81fa178b74..3c105fd603 100644
--- a/src/openhuman/tools/impl/filesystem/git_operations.rs
+++ b/src/openhuman/tools/impl/filesystem/git_operations.rs
@@ -4,7 +4,7 @@ use async_trait::async_trait;
use serde_json::json;
use std::path::{Path, PathBuf};
use std::sync::Arc;
-use tinyagents::harness::tool::ToolExecutionContext;
+use tinytools::ToolRunContext;
/// Git operations tool for structured repository management.
/// Provides safe, parsed git operations with JSON output.
diff --git a/src/openhuman/tools/impl/filesystem/glob_search.rs b/src/openhuman/tools/impl/filesystem/glob_search.rs
index 49aa5e95b5..46906c8b6b 100644
--- a/src/openhuman/tools/impl/filesystem/glob_search.rs
+++ b/src/openhuman/tools/impl/filesystem/glob_search.rs
@@ -30,7 +30,7 @@ use glob::Pattern;
use serde_json::json;
use std::path::Path;
use std::sync::Arc;
-use tinyagents::harness::tool::ToolExecutionContext;
+use tinytools::ToolRunContext;
use walkdir::WalkDir;
const DEFAULT_MAX_RESULTS: usize = 500;
diff --git a/src/openhuman/tools/impl/filesystem/grep.rs b/src/openhuman/tools/impl/filesystem/grep.rs
index 7da50add92..539a0f99ff 100644
--- a/src/openhuman/tools/impl/filesystem/grep.rs
+++ b/src/openhuman/tools/impl/filesystem/grep.rs
@@ -12,7 +12,7 @@ use regex::Regex;
use serde_json::json;
use std::path::Path;
use std::sync::Arc;
-use tinyagents::harness::tool::ToolExecutionContext;
+use tinytools::ToolRunContext;
use walkdir::WalkDir;
const DEFAULT_MAX_MATCHES: usize = 200;
diff --git a/src/openhuman/tools/impl/filesystem/list_files.rs b/src/openhuman/tools/impl/filesystem/list_files.rs
index 9caf6eb837..33a6de70f0 100644
--- a/src/openhuman/tools/impl/filesystem/list_files.rs
+++ b/src/openhuman/tools/impl/filesystem/list_files.rs
@@ -9,7 +9,7 @@ use crate::openhuman::tools::traits::{PermissionLevel, Tool, ToolCallOptions, To
use async_trait::async_trait;
use serde_json::json;
use std::sync::Arc;
-use tinyagents::harness::tool::ToolExecutionContext;
+use tinytools::ToolRunContext;
const MAX_ENTRIES: usize = 1_000;
diff --git a/src/openhuman/tools/impl/filesystem/mod.rs b/src/openhuman/tools/impl/filesystem/mod.rs
index 9c82b94d2f..65c3d411ab 100644
--- a/src/openhuman/tools/impl/filesystem/mod.rs
+++ b/src/openhuman/tools/impl/filesystem/mod.rs
@@ -14,7 +14,7 @@ mod update_memory_md;
use crate::openhuman::security::policy::{TrustedAccess, TrustedRoot};
use crate::openhuman::security::SecurityPolicy;
-use tinyagents::harness::tool::ToolExecutionContext;
+use tinytools::ToolRunContext;
#[cfg(test)]
#[path = "mod_tests.rs"]
diff --git a/src/openhuman/tools/impl/filesystem/read_diff.rs b/src/openhuman/tools/impl/filesystem/read_diff.rs
index 8e84497e84..1aa5e916a0 100644
--- a/src/openhuman/tools/impl/filesystem/read_diff.rs
+++ b/src/openhuman/tools/impl/filesystem/read_diff.rs
@@ -4,7 +4,7 @@ use crate::openhuman::tools::traits::{PermissionLevel, Tool, ToolCallOptions, To
use async_trait::async_trait;
use serde_json::json;
use std::path::PathBuf;
-use tinyagents::harness::tool::ToolExecutionContext;
+use tinytools::ToolRunContext;
/// Returns `git diff` output in a structured format.
pub struct ReadDiffTool {
diff --git a/src/openhuman/tools/impl/filesystem/run_linter.rs b/src/openhuman/tools/impl/filesystem/run_linter.rs
index c7a8068bb4..39d7cf14bd 100644
--- a/src/openhuman/tools/impl/filesystem/run_linter.rs
+++ b/src/openhuman/tools/impl/filesystem/run_linter.rs
@@ -4,7 +4,7 @@ use crate::openhuman::tools::traits::{PermissionLevel, Tool, ToolCallOptions, To
use async_trait::async_trait;
use serde_json::json;
use std::path::PathBuf;
-use tinyagents::harness::tool::ToolExecutionContext;
+use tinytools::ToolRunContext;
/// Runs linters (cargo clippy, eslint) and returns structured findings.
pub struct RunLinterTool {
diff --git a/src/openhuman/tools/impl/filesystem/run_tests.rs b/src/openhuman/tools/impl/filesystem/run_tests.rs
index 43111971a3..518d77b2a8 100644
--- a/src/openhuman/tools/impl/filesystem/run_tests.rs
+++ b/src/openhuman/tools/impl/filesystem/run_tests.rs
@@ -4,7 +4,7 @@ use crate::openhuman::tools::traits::{PermissionLevel, Tool, ToolCallOptions, To
use async_trait::async_trait;
use serde_json::json;
use std::path::PathBuf;
-use tinyagents::harness::tool::ToolExecutionContext;
+use tinytools::ToolRunContext;
/// Runs test suites (cargo test, vitest) and returns pass/fail with output.
pub struct RunTestsTool {
diff --git a/src/openhuman/tools/impl/filesystem/update_memory_md.rs b/src/openhuman/tools/impl/filesystem/update_memory_md.rs
index 3716bf2f2d..a6d790cf8f 100644
--- a/src/openhuman/tools/impl/filesystem/update_memory_md.rs
+++ b/src/openhuman/tools/impl/filesystem/update_memory_md.rs
@@ -7,7 +7,7 @@ use std::collections::HashMap;
use std::path::{Path, PathBuf};
use std::sync::atomic::{AtomicU64, Ordering};
use std::sync::{Arc, LazyLock, Mutex};
-use tinyagents::harness::tool::ToolExecutionContext;
+use tinytools::ToolRunContext;
/// Allowed workspace markdown files this tool may modify.
const ALLOWED_FILES: &[&str] = &["MEMORY.md", "SKILL.md"];
diff --git a/src/openhuman/tools/impl/system/mod.rs b/src/openhuman/tools/impl/system/mod.rs
index f4198ec9d5..89fc77b997 100644
--- a/src/openhuman/tools/impl/system/mod.rs
+++ b/src/openhuman/tools/impl/system/mod.rs
@@ -21,7 +21,7 @@ mod workspace_state;
use crate::openhuman::security::policy::{TrustedAccess, TrustedRoot};
use crate::openhuman::security::SecurityPolicy;
use std::path::Path;
-use tinyagents::harness::tool::ToolExecutionContext;
+use tinytools::ToolRunContext;
pub use current_time::CurrentTimeTool;
pub use detect_tools::DetectToolsTool;
diff --git a/src/openhuman/tools/impl/system/node_exec.rs b/src/openhuman/tools/impl/system/node_exec.rs
index ae379e8eca..74404d0d89 100644
--- a/src/openhuman/tools/impl/system/node_exec.rs
+++ b/src/openhuman/tools/impl/system/node_exec.rs
@@ -31,7 +31,7 @@ use async_trait::async_trait;
use serde_json::json;
use std::sync::Arc;
use std::time::Duration;
-use tinyagents::harness::tool::ToolExecutionContext;
+use tinytools::ToolRunContext;
/// Absolute ceiling a caller may request via `timeout_secs`. There is **no**
/// default timeout — `node_exec` runs scripts that legitimately take minutes
diff --git a/src/openhuman/tools/impl/system/npm_exec.rs b/src/openhuman/tools/impl/system/npm_exec.rs
index 486dcc030a..0c6cb43524 100644
--- a/src/openhuman/tools/impl/system/npm_exec.rs
+++ b/src/openhuman/tools/impl/system/npm_exec.rs
@@ -27,7 +27,7 @@ use async_trait::async_trait;
use serde_json::json;
use std::sync::Arc;
use std::time::Duration;
-use tinyagents::harness::tool::ToolExecutionContext;
+use tinytools::ToolRunContext;
/// Absolute ceiling callers can request via `timeout_secs`. There is **no**
/// default timeout — `npm install`/build steps on a cold cache or slow network
diff --git a/src/openhuman/tools/impl/system/python_exec.rs b/src/openhuman/tools/impl/system/python_exec.rs
index f5f9e4f3c7..ceb242ee32 100644
--- a/src/openhuman/tools/impl/system/python_exec.rs
+++ b/src/openhuman/tools/impl/system/python_exec.rs
@@ -26,7 +26,7 @@ use async_trait::async_trait;
use serde_json::json;
use std::sync::Arc;
use std::time::Duration;
-use tinyagents::harness::tool::ToolExecutionContext;
+use tinytools::ToolRunContext;
/// Absolute ceiling a caller may request via `timeout_secs`. No default timeout —
/// Python scripts legitimately take minutes; a deadline applies only when
diff --git a/src/openhuman/tools/impl/system/shell.rs b/src/openhuman/tools/impl/system/shell.rs
index de66307476..f2a9c1bfbe 100644
--- a/src/openhuman/tools/impl/system/shell.rs
+++ b/src/openhuman/tools/impl/system/shell.rs
@@ -11,6 +11,7 @@ use std::path::{Path, PathBuf};
use std::sync::Arc;
use std::time::{Duration, Instant};
use tinyagents::harness::tool::ToolExecutionContext;
+use tinytools::ToolRunContext;
/// Maximum output size in bytes (1MB).
const MAX_OUTPUT_BYTES: usize = 1_048_576;