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/module_client.rs
Steven Enamakel6159999c6897
diff --git a/crates/openhuman-core/src/mcp/module_client.rs b/crates/openhuman-core/src/mcp/module_client.rsindex 0674ef30fa..3c7f1f0bfc 100644--- a/crates/openhuman-core/src/mcp/module_client.rs+++ b/crates/openhuman-core/src/mcp/module_client.rs@@ -431,6 +431,9 @@ impl McpConfiguredClient {let Some(client) = Self::retire_cached_client(&key) else {return Self::finish_cleanup(&key, None, reservation);};+ if let Some(cleaned) = Self::finish_closed_client_synchronously(&key, &client, &reservation) {+ return cleaned;+ }Self::close_retired_client(key, client, reservation).await}@@ -444,6 +447,9 @@ impl McpConfiguredClient {Self::finish_cleanup(&key, None, reservation);return;};+ if Self::finish_closed_client_synchronously(&key, &client, &reservation).is_some() {+ return;+ }let Ok(runtime) = tokio::runtime::Handle::try_current() else {return;};@@ -469,6 +475,9 @@ impl McpConfiguredClient {}return;};+ if Self::finish_closed_client_synchronously(&key, &client, &reservation).is_some() {+ return;+ }let Ok(runtime) = tokio::runtime::Handle::try_current() else {return;};@@ -579,6 +588,21 @@ impl McpConfiguredClient {Some(Arc::clone(client))}+ fn finish_closed_client_synchronously(+ data_dir: &std::path::Path,+ client: &Arc<Self>,+ reservation: &Arc<CleanupReservation>,+ ) -> Option<bool> {+ let Ok(state) = client.state.try_lock() else {+ return None;+ };+ let is_closed = matches!(&*state, State::Closed);+ drop(state);+ is_closed.then(|| {+ Self::finish_cleanup(data_dir, Some(Arc::clone(client)), Arc::clone(reservation))+ })+ }+async fn close_retired_client(data_dir: PathBuf,client: Arc<Self>,