Skip to content

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

test(mcp): isolate workspace env in dispatch policy test

Steven Enamakel1cf2455bf1f2
diff --git a/crates/openhuman-core/src/mcp/server/tools_tests_dispatch_tests.rs b/crates/openhuman-core/src/mcp/server/tools_tests_dispatch_tests.rs
index 6925265d5a..b89538b8fa 100644
--- a/crates/openhuman-core/src/mcp/server/tools_tests_dispatch_tests.rs
+++ b/crates/openhuman-core/src/mcp/server/tools_tests_dispatch_tests.rs
@@ -163,6 +163,9 @@ async fn call_tool_judges_the_policy_of_the_explicit_context_across_scopes() {
// The module resolves the installed storage from the process environment,
// so the env lock and the ambient install guard it like the sibling tests.
let _env_lock = crate::config::TEST_ENV_LOCK.lock().await;
+ unsafe {
+ std::env::set_var("OPENHUMAN_WORKSPACE", tmp_allow.path());
+ }
let ambient = AmbientStorage::install();
denying.storage.url = Some(ambient._fixture.url.clone());
allowing.storage.url = Some(ambient._fixture.url.clone());
@@ -195,4 +198,7 @@ async fn call_tool_judges_the_policy_of_the_explicit_context_across_scopes() {
"the permissive context reaches agent construction: {}",
allowed.message()
);
+ unsafe {
+ std::env::remove_var("OPENHUMAN_WORKSPACE");
+ }
}