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
fix(host): handle missing MCP server gracefully on shutdown\n\nWhen the MCP host is shut down before a server has been fully initialized, attempting to access the server's process handle causes a panic. This change adds a guard to check for the server's presence before attempting to terminate it, ensuring a clean shutdown in all initialization states.\n\nAuto-committed-on: dragonfly\n
Steven Enamakelfcbfa104da85
diff --git a/src/openhuman/mcp/host.rs b/src/openhuman/mcp/host.rsindex df0c7928f2..b392399b8a 100644--- a/src/openhuman/mcp/host.rs+++ b/src/openhuman/mcp/host.rs@@ -183,13 +183,15 @@ pub fn for_config(config: &Config) -> anyhow::Result<Arc<McpHost>> {.unwrap_or_else(|poisoned| poisoned.into_inner()).get(&workspace){- return Ok(Arc::clone(existing));+ return Ok(Arc::clone(&existing.host));}// Build outside the lock: opening runs the store's migrations and builds// an HTTP client, neither of which should serialize or block a Tokio- // worker behind the process-wide map.- let service = Arc::new(McpHost::open(config)?);+ // worker behind the process-wide map. The client configuration is+ // converted once, so the host and the entry stored beside it share it.+ let client = client_config(config);+ let service = Arc::new(McpHost::from_client_config(&workspace, &client)?);// Recheck before inserting — a concurrent initializer may have won the// race while the service was being built. Its Arc wins; ours is dropped.@@ -198,10 +200,17 @@ pub fn for_config(config: &Config) -> anyhow::Result<Arc<McpHost>> {.unwrap_or_else(|poisoned| poisoned.into_inner());if let Some(existing) = hosts.get(&workspace) {- return Ok(Arc::clone(existing));+ return Ok(Arc::clone(&existing.host));}- hosts.insert(workspace, Arc::clone(&service));+ hosts.insert(+ workspace,+ HostEntry {+ host: Arc::clone(&service),+ identity: client.client_identity,+ proxy: client.proxy,+ },+ );Ok(service)}