Skip to content

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

fix(mcp): check cleanup pending before test hook

Steven Enamakel0709abdc9ad9
diff --git a/crates/openhuman-core/src/mcp/module_client.rs b/crates/openhuman-core/src/mcp/module_client.rs
index 6767945fef..6026b323be 100644
--- a/crates/openhuman-core/src/mcp/module_client.rs
+++ b/crates/openhuman-core/src/mcp/module_client.rs
@@ -263,6 +263,9 @@ impl McpConfiguredClient {
return Err(ModuleCallError::Unavailable);
}
let data_dir = crate::core::runtime::agent_scope_dir(config);
+ if Self::cleanup_pending(&data_dir) {
+ return Err(ModuleCallError::Unavailable);
+ }
#[cfg(test)]
{
let mut hook = AFTER_CONTEXT_CHECK
@@ -278,9 +281,6 @@ impl McpConfiguredClient {
}
}
}
- if current_agent_context_is_removed() || Self::cleanup_pending(&data_dir) {
- return Err(ModuleCallError::Unavailable);
- }
let clients = CLIENTS.get_or_init(|| Mutex::new(HashMap::new()));
let mut clients = clients
.lock()