Skip to content

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

feat(registry): add workspace-scoped tool lookup for multi-host tests\n\nAdd `all_connected_tools_for_config` to resolve tools through a specific `Config` rather than the process-wide default host. This prevents test binaries from silently reporting no tools when multiple tests each open their own temporary workspace, since the ambient lookup returns `None` once a second host exists. A host that cannot be opened yields an empty list so that MCP unavailability does not fail tool listing.\n\nAuto-committed-on: dragonfly\n

Steven Enamakelf6918c94271f
diff --git a/src/openhuman/mcp/registry/mod.rs b/src/openhuman/mcp/registry/mod.rs
index 875417437c..a76966f2fe 100644
--- a/src/openhuman/mcp/registry/mod.rs
+++ b/src/openhuman/mcp/registry/mod.rs
@@ -88,6 +88,35 @@ pub mod connections {
}
}
+ /// Every tool on every connected server in `config`'s workspace.
+ ///
+ /// The counterpart to [`all_connected_tools`] for a caller that holds a
+ /// `Config`. It resolves through [`host::for_config`], which is keyed by
+ /// workspace, rather than through the process-wide default — so it answers
+ /// about the workspace the caller named instead of whichever one
+ /// `mcp::init` happened to claim first.
+ ///
+ /// That distinction is invisible in the shipped app, which opens one
+ /// workspace, and decisive in a test binary: `resolve` hands back a lone
+ /// host but returns `None` once a second one exists, so an ambient lookup
+ /// silently reports nothing connected as soon as two tests each open their
+ /// own temporary workspace in one process.
+ ///
+ /// A host that cannot be opened yields an empty list rather than an error:
+ /// the callers fold this into a tool list, and MCP being unavailable must
+ /// not fail the listing.
+ pub async fn all_connected_tools_for_config(
+ config: &Config,
+ ) -> Vec<(String, String, tinymcp_bus::McpTool)> {
+ match host::for_config(config) {
+ Ok(service) => service.dynamic().connections().all_connected_tools().await,
+ Err(error) => {
+ tracing::debug!(?error, "[mcp] no host for workspace; reporting no tools");
+ Vec::new()
+ }
+ }
+ }
+
/// Every tool on every connected server, paired with its server.
pub async fn all_connected_tools() -> Vec<(String, String, tinymcp_bus::McpTool)> {
match host::try_service() {