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(sandbox): move host runtime adapters into the sandbox module
Steven Enamakel9c93a6801ee8
diff --git a/crates/openhuman-core/src/agent/mod.rs b/crates/openhuman-core/src/agent/mod.rsindex 65f69bdfca..fddb0ab201 100644--- a/crates/openhuman-core/src/agent/mod.rs+++ b/crates/openhuman-core/src/agent/mod.rs@@ -25,8 +25,6 @@ pub(crate) mod cost;pub mod goals;pub mod harness;pub mod hooks;-/// Host-side runtime adapters used by agent tools and shell policy.-pub mod host_runtime;/// Host-registered agents the core's own drivers (cron, workflow nodes) can/// resolve by id, with their definition, host tools and context.pub mod host_agents;diff --git a/crates/openhuman-core/src/agent/session_host/builder/factory.rs b/crates/openhuman-core/src/agent/session_host/builder/factory.rsindex 200e6e0532..45e5922a6b 100644--- a/crates/openhuman-core/src/agent/session_host/builder/factory.rs+++ b/crates/openhuman-core/src/agent/session_host/builder/factory.rs@@ -8,7 +8,7 @@ use crate::agent_registry::host_definition::{};use crate::config::Config;use crate::core::runtime::DispatchCtx;-use crate::agent::host_runtime;+use crate::sandbox::host_runtime;use crate::security::SecurityPolicy;use crate::tools;use anyhow::Result;diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware/failure_policy.rs b/crates/openhuman-core/src/agent/tinyagents/middleware/failure_policy.rsindex 06c2cb5f12..d3960b7aad 100644--- a/crates/openhuman-core/src/agent/tinyagents/middleware/failure_policy.rs+++ b/crates/openhuman-core/src/agent/tinyagents/middleware/failure_policy.rs@@ -100,7 +100,7 @@ const ALWAYS_RETRYABLE_ON_TIMEOUT: &[&str] = &[/// The shell agent commands run under on this host, for a nudge that has to/// say which commands exist.fn host_shell_description() -> String {- let shell = match crate::agent::host_runtime::host_shell_flavor() {+ let shell = match crate::sandbox::host_runtime::host_shell_flavor() {tinybox_bus::ShellFlavor::Cmd => "cmd.exe",tinybox_bus::ShellFlavor::Posix => "bash or sh",};diff --git a/crates/openhuman-core/src/channels/runtime/startup/turn_parts.rs b/crates/openhuman-core/src/channels/runtime/startup/turn_parts.rsindex d1808cb576..f5a2bbfb3d 100644--- a/crates/openhuman-core/src/channels/runtime/startup/turn_parts.rs+++ b/crates/openhuman-core/src/channels/runtime/startup/turn_parts.rs@@ -13,7 +13,7 @@ use crate::channels::system_prompt::{ChannelPromptInputs, ChannelSystemPrompt};use crate::config::Config;use crate::core::runtime::DispatchCtx;use crate::inference::provider;-use crate::agent::host_runtime;+use crate::sandbox::host_runtime;use crate::security::SecurityPolicy;use crate::tools;use anyhow::Result;diff --git a/crates/openhuman-core/src/inference/host_runtime/mod.rs b/crates/openhuman-core/src/inference/host_runtime/mod.rsindex fabd370a8d..9d5ce74648 100644--- a/crates/openhuman-core/src/inference/host_runtime/mod.rs+++ b/crates/openhuman-core/src/inference/host_runtime/mod.rs@@ -25,7 +25,7 @@ pub mod ops;mod schemas;// `pub(crate)` so the shared `apply_no_window` helper can be reused from the-// agent shell runtime (`agent::host_runtime`) — single source of truth for the+// agent shell runtime (`sandbox::host_runtime`) — single source of truth for the// Windows `CREATE_NO_WINDOW` flag (#3727/#3728).pub mod service;diff --git a/crates/openhuman-core/src/sandbox/README.md b/crates/openhuman-core/src/sandbox/README.mdindex 8b6ceb03b1..80e5fd3aea 100644--- a/crates/openhuman-core/src/sandbox/README.md+++ b/crates/openhuman-core/src/sandbox/README.md@@ -233,7 +233,7 @@ The settings surface (`get_sandbox_settings`, `[security.sandbox]` anddefault install the sandbox and the `is_always_forbidden` floor are whatbound an agent.- Shell selection and the child environment for each platform are TinyBox's- (`SelectShell` / `StartNativeShellExec`); `agent::host_runtime::host_shell_flavor`+ (`SelectShell` / `StartNativeShellExec`); `sandbox::host_runtime::host_shell_flavor`only tells the model which family that is.- The agent's `SandboxMode` is declared in its definition(`tinyagents_definition::SandboxMode`) and read per call throughdiff --git a/crates/openhuman-core/src/agent/host_runtime.rs b/crates/openhuman-core/src/sandbox/host_runtime.rssimilarity index 100%rename from crates/openhuman-core/src/agent/host_runtime.rsrename to crates/openhuman-core/src/sandbox/host_runtime.rsdiff --git a/crates/openhuman-core/src/agent/host_runtime_tests.rs b/crates/openhuman-core/src/sandbox/host_runtime_tests.rssimilarity index 100%rename from crates/openhuman-core/src/agent/host_runtime_tests.rsrename to crates/openhuman-core/src/sandbox/host_runtime_tests.rsdiff --git a/crates/openhuman-core/src/sandbox/mod.rs b/crates/openhuman-core/src/sandbox/mod.rsindex f6b817bcec..3d091c0624 100644--- a/crates/openhuman-core/src/sandbox/mod.rs+++ b/crates/openhuman-core/src/sandbox/mod.rs@@ -11,6 +11,7 @@//! explicit elevated escape paths.pub mod docker;+pub mod host_runtime;pub(crate) mod local_grants;pub(crate) mod native_jail;pub mod ops;diff --git a/crates/openhuman-core/src/tools/impl/system/shell.rs b/crates/openhuman-core/src/tools/impl/system/shell.rsindex 279dbcd63f..aac7e8faa6 100644--- a/crates/openhuman-core/src/tools/impl/system/shell.rs+++ b/crates/openhuman-core/src/tools/impl/system/shell.rs@@ -5,7 +5,7 @@ use super::shell_support::{command_failure, exec_result, python_utf8_env, tool_tuse crate::agent::tinyagents::host::run_context::dispatch_ctx_for_tool;use crate::config::Config;use crate::core::runtime::DispatchCtx;-use crate::agent::host_runtime::RuntimeAdapter;+use crate::sandbox::host_runtime::RuntimeAdapter;use crate::security::{AuditLogger, CommandExecutionLog, SecurityPolicy};use async_trait::async_trait;use serde_json::json;diff --git a/crates/openhuman-core/src/tools/impl/system/shell_description.rs b/crates/openhuman-core/src/tools/impl/system/shell_description.rsindex 7a6ac2ebec..e7ad17c9bb 100644--- a/crates/openhuman-core/src/tools/impl/system/shell_description.rs+++ b/crates/openhuman-core/src/tools/impl/system/shell_description.rs@@ -5,7 +5,7 @@//! a pure function of the contract's [`ShellFlavor`] so both flavors are testable//! on any host.-use crate::agent::host_runtime::ShellFlavor;+use crate::sandbox::host_runtime::ShellFlavor;/// The `shell` tool description for the shell this host spawns. Models default/// to POSIX syntax, so on Windows the description says outright that commandsdiff --git a/crates/openhuman-core/src/tools/impl/system/shell_tests.rs b/crates/openhuman-core/src/tools/impl/system/shell_tests.rsindex f13ee919ad..51c28dd3f3 100644--- a/crates/openhuman-core/src/tools/impl/system/shell_tests.rs+++ b/crates/openhuman-core/src/tools/impl/system/shell_tests.rs@@ -1,5 +1,5 @@use super::*;-use crate::agent::host_runtime::{NativeRuntime, RuntimeAdapter};+use crate::sandbox::host_runtime::{NativeRuntime, RuntimeAdapter};use crate::security::{AutonomyLevel, SecurityPolicy};use tinybox_bus::CommandClass;diff --git a/crates/openhuman-core/src/tools/impl/system/shell_tests_platform_tests.rs b/crates/openhuman-core/src/tools/impl/system/shell_tests_platform_tests.rsindex 503a4a6a14..cc31e57ace 100644--- a/crates/openhuman-core/src/tools/impl/system/shell_tests_platform_tests.rs+++ b/crates/openhuman-core/src/tools/impl/system/shell_tests_platform_tests.rs@@ -5,7 +5,7 @@//! pinned on every CI host, not only on a Windows runner.use super::*;-use crate::agent::host_runtime::{host_shell_flavor, ShellFlavor};+use crate::sandbox::host_runtime::{host_shell_flavor, ShellFlavor};#[cfg(feature = "modules")]use crate::tools::system::shell_support::PYTHON_UTF8_DEFAULTS;use std::collections::HashMap;@@ -185,7 +185,7 @@ fn the_tool_describes_the_shell_its_runtime_spawns() {#[test]fn the_docker_runtime_always_runs_posix_sh() {- let docker = crate::agent::host_runtime::create_runtime(+ let docker = crate::sandbox::host_runtime::create_runtime(&crate::config::RuntimeConfig {kind: "docker".into(),..crate::config::RuntimeConfig::default()diff --git a/crates/openhuman-core/src/tools/native_ops.rs b/crates/openhuman-core/src/tools/native_ops.rsindex 6f0ec24d0a..e3089f9088 100644--- a/crates/openhuman-core/src/tools/native_ops.rs+++ b/crates/openhuman-core/src/tools/native_ops.rs@@ -4,7 +4,7 @@ use std::time::Instant;use crate::config::Config;use crate::core::bus::BUS;use crate::core::events::DomainEvent;-use crate::agent::host_runtime::{NativeRuntime, RuntimeAdapter};+use crate::sandbox::host_runtime::{NativeRuntime, RuntimeAdapter};use crate::security::SecurityPolicy;use crate::tools;use crate::tools::native_ops_types::{ExecuteToolOutcome, RuntimeToolSummary};diff --git a/crates/openhuman-core/src/tools/ops.rs b/crates/openhuman-core/src/tools/ops.rsindex efc5c0f312..f2bda3b270 100644--- a/crates/openhuman-core/src/tools/ops.rs+++ b/crates/openhuman-core/src/tools/ops.rs@@ -2,7 +2,7 @@use super::implementations::network::{McpListServersTool, McpListToolsTool};use super::*;use crate::config::{Config, DelegateAgentConfig};-use crate::agent::host_runtime::{NativeRuntime, RuntimeAdapter};+use crate::sandbox::host_runtime::{NativeRuntime, RuntimeAdapter};use crate::security::{AuditLogger, SecurityPolicy};use crate::tools::delegate::DelegateTool;use std::collections::HashMap;