Skip to content

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

docs(host): clarify why host construction is not done under a lock

Steven Enamakel2d0463474de0
diff --git a/src/openhuman/mcp/host.rs b/src/openhuman/mcp/host.rs
index fc0e60ebf5..b248564d86 100644
--- a/src/openhuman/mcp/host.rs
+++ b/src/openhuman/mcp/host.rs
@@ -138,13 +138,13 @@ impl McpHost {
///
/// Returns an error when the stores cannot be opened or an HTTP client cannot
/// be built.
-/// Opens the service for `config`, without holding the process-wide lock.
///
-/// Building a host runs the store's migrations and constructs an HTTP client,
-/// which no request path should pay for and no lock should be held across.
-/// So the host is opened first, and only then is the map locked to see whether
-/// another initializer won the race; if one did, its service is returned and
-/// the freshly-built one is dropped.
+/// Opening is not done under the process-wide lock: building a host runs the
+/// store's migrations and constructs an HTTP client, which no request path
+/// should pay for and no lock should be held across. The host is built first,
+/// and only then is the map locked to see whether another initializer won the
+/// race; if one did, its service is returned and the freshly-built one is
+/// dropped.
pub fn for_config(config: &Config) -> anyhow::Result<Arc<McpHost>> {
let workspace = config.workspace_dir.clone();