Skip to content

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

chore(mcp): log why the configured client is unavailable

Steven Enamakelbf5ca4523c97
diff --git a/crates/openhuman-core/src/mcp/module_client/lifecycle.rs b/crates/openhuman-core/src/mcp/module_client/lifecycle.rs
index 1c422d24ab..13ea13eae3 100644
--- a/crates/openhuman-core/src/mcp/module_client/lifecycle.rs
+++ b/crates/openhuman-core/src/mcp/module_client/lifecycle.rs
@@ -17,14 +17,17 @@ impl McpConfiguredClient {
/// serialized by the client itself.
pub(crate) fn for_config(config: &Config) -> Result<Arc<Self>, ModuleCallError> {
if SHUTTING_DOWN.load(Ordering::Acquire) {
+ tracing::debug!("[mcp] configured client unavailable: shutdown is in progress");
crate::modules::report::unavailable(MODULE);
return Err(ModuleCallError::Unavailable);
}
if !config.modules.enabled {
+ tracing::debug!("[mcp] configured client unavailable: modules are disabled");
crate::modules::report::unavailable(MODULE);
return Err(ModuleCallError::Unavailable);
}
if current_agent_context_is_removed() {
+ tracing::debug!("[mcp] configured client unavailable: agent context was removed");
crate::modules::report::unavailable(MODULE);
return Err(ModuleCallError::Unavailable);
}
@@ -38,7 +41,8 @@ impl McpConfiguredClient {
})
.map_err(|error| match error {
AdmitError::Create(error) => error,
- _ => {
+ other => {
+ tracing::debug!(?other, "[mcp] configured client admission rejected");
crate::modules::report::unavailable(MODULE);
ModuleCallError::Unavailable
}