Skip to content

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

test(mcp-ui): pin the workspace through EnvVarGuard in schema tests

oxoxDev44d63e8d721b
diff --git a/crates/openhuman-core/src/mcp/ui/schemas_tests.rs b/crates/openhuman-core/src/mcp/ui/schemas_tests.rs
index 004283a95c..5df38fb169 100644
--- a/crates/openhuman-core/src/mcp/ui/schemas_tests.rs
+++ b/crates/openhuman-core/src/mcp/ui/schemas_tests.rs
@@ -25,14 +25,8 @@ fn tool_call_requires_server_and_tool() {
async fn with_workspace<F: std::future::Future>(body: F) -> F::Output {
let _env_lock = crate::config::TEST_ENV_LOCK.lock().await;
let workspace = tempfile::tempdir().expect("workspace");
- unsafe {
- std::env::set_var("OPENHUMAN_WORKSPACE", workspace.path());
- }
- let output = body.await;
- unsafe {
- std::env::remove_var("OPENHUMAN_WORKSPACE");
- }
- output
+ let _workspace_env = crate::config::test_env::EnvVarGuard::workspace_unlocked(workspace.path());
+ body.await
}
fn params(value: Value) -> Map<String, Value> {