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
chore: files changed crates/openhuman-core/src/mcp/host_tests.rs,crates/openhuman-core/src/mcp/modul
Steven Enamakel71676b0f5a73
diff --git a/crates/openhuman-core/src/mcp/host_sandbox_tests.rs b/crates/openhuman-core/src/mcp/host_sandbox_tests.rsnew file mode 100644index 0000000000..b63f537caf--- /dev/null+++ b/crates/openhuman-core/src/mcp/host_sandbox_tests.rs@@ -0,0 +1,51 @@+use super::*;++fn config_in(dir: &Path) -> Config {+ let mut config = Config::default();+ config.workspace_dir = dir.to_path_buf();+ config+}++#[cfg(feature = "modules")]+#[test]+fn sandbox_workspace_is_a_dedicated_directory_inside_the_core_workspace() {+ let tmp = tempfile::tempdir().unwrap();+ let sandbox = stdio_sandbox(&config_in(tmp.path())).expect("a sandbox");+ let expected = tmp.path().join(WORKSPACE_DIR).canonicalize().unwrap();+ assert_eq!(sandbox.workspace, expected.to_string_lossy());+ assert!(expected.is_dir());+ assert!(sandbox.allow_subprocess);+}++#[cfg(feature = "modules")]+#[test]+fn configured_grants_pass_the_host_floor() {+ let tmp = tempfile::tempdir().unwrap();+ let granted = tmp.path().join("tools");+ std::fs::create_dir_all(&granted).unwrap();+ let mut config = config_in(tmp.path());+ config.runtime.local_jail.extra_read_only = vec![+ granted.to_string_lossy().into_owned(),+ "/etc".into(),+ "relative/path".into(),+ "/no/such/dir/anywhere".into(),+ ];+ let sandbox = stdio_sandbox(&config).expect("a sandbox");+ let granted = granted.canonicalize().unwrap().to_string_lossy().into_owned();+ assert_eq!(sandbox.read_only, vec![granted]);+}++#[test]+fn isolation_floor_is_required_except_for_the_macos_desktop() {+ assert!(require_process_isolation(true));+ assert_eq!(require_process_isolation(false), !cfg!(target_os = "macos"));+}++#[test]+fn a_grant_that_contains_a_credential_store_is_not_admitted() {+ let home = Path::new("/home/user");+ assert!(exposes_credentials(Path::new("/home/user"), Some(home)));+ assert!(exposes_credentials(Path::new("/home/user/.ssh"), Some(home)));+ assert!(!exposes_credentials(Path::new("/home/user/tools"), Some(home)));+ assert!(!exposes_credentials(Path::new("/home/user"), None));+}diff --git a/crates/openhuman-core/src/mcp/host_tests.rs b/crates/openhuman-core/src/mcp/host_tests.rsindex 06573e85ad..0b2211ce2a 100644--- a/crates/openhuman-core/src/mcp/host_tests.rs+++ b/crates/openhuman-core/src/mcp/host_tests.rs@@ -163,3 +163,30 @@ async fn ambient_config_follows_the_explicit_context() {"an unbound context falls back to the process default, never a scope");}++#[cfg(feature = "modules")]+#[test]+fn registry_stdio_servers_get_the_host_jail_and_are_never_operator_trusted() {+ let tmp = tempfile::tempdir().unwrap();+ let mut config = Config::default();+ config.workspace_dir = tmp.path().to_path_buf();+ config.mcp_client.servers.push(populated_server());++ let converted = client_config(&config);+ let sandbox = converted+ .stdio_sandbox+ .as_ref()+ .expect("tinymcp refuses stdio servers without a stdio_sandbox");+ assert!(std::path::Path::new(&sandbox.workspace).is_dir());+ assert!(sandbox.workspace.starts_with(+ &tmp.path().canonicalize().unwrap().to_string_lossy().into_owned()+ ));+ assert_eq!(+ sandbox.require_process_isolation,+ super::super::host_sandbox::require_process_isolation(false)+ );+ assert!(+ converted.servers.iter().all(|server| !server.operator_trusted),+ "the host must not vouch for servers it did not configure as trusted"+ );+}diff --git a/crates/openhuman-core/src/mcp/module_port.rs b/crates/openhuman-core/src/mcp/module_port.rsindex 98295ab854..6a5201774d 100644--- a/crates/openhuman-core/src/mcp/module_port.rs+++ b/crates/openhuman-core/src/mcp/module_port.rs@@ -7,13 +7,6 @@ pub(super) struct TinyMcpPort {root: ModuleClient,/// The host config the stdio sandbox's toolchain grants resolve against.host_config: Option<crate::config::Config>,- /// Resolves the stdio sandbox's toolchain grants against `config` when the- /// configured client is opened.- pub(super) fn with_host_config(mut self, config: crate::config::Config) -> Self {- self.host_config = Some(config);- self- }-#[cfg(feature = "modules")]pinned: tokio::sync::OnceCell<ModuleObjectClient>,}@@ -28,6 +21,13 @@ impl TinyMcpPort {}}+ /// Resolves the stdio sandbox's toolchain grants against `config` when the+ /// configured client is opened.+ pub(super) fn with_host_config(mut self, config: crate::config::Config) -> Self {+ self.host_config = Some(config);+ self+ }+#[cfg(feature = "modules")]async fn pinned(&self) -> Result<&ModuleObjectClient, ModuleCallError> {self.pinned