Skip to content

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

fix(mcp): recheck removed agent context before creating client

Steven Enamakel663ddf66eba6
diff --git a/crates/openhuman-core/src/mcp/module_client.rs b/crates/openhuman-core/src/mcp/module_client.rs
index 703489d735..6026b323be 100644
--- a/crates/openhuman-core/src/mcp/module_client.rs
+++ b/crates/openhuman-core/src/mcp/module_client.rs
@@ -287,7 +287,7 @@ impl McpConfiguredClient {
.unwrap_or_else(std::sync::PoisonError::into_inner);
// The cleanup reservation can be installed after the first check but
// before this cache lock is acquired. Recheck before creating a client.
- if Self::cleanup_pending(&data_dir) {
+ if current_agent_context_is_removed() || Self::cleanup_pending(&data_dir) {
ModuleClient::report_unavailable(MODULE);
return Err(ModuleCallError::Unavailable);
}