The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(mcp_startup): take the deferred slot under the lock so two racing first clients fire once
kshitijk4poor639823919ced
diff --git a/hermes_cli/mcp_startup.py b/hermes_cli/mcp_startup.pyindex 55712eccecd..44a61379d3a 100644--- a/hermes_cli/mcp_startup.py+++ b/hermes_cli/mcp_startup.py@@ -211,8 +211,9 @@ def defer_background_mcp_discovery(*, logger, thread_name: str, delay: float | Ndef start_deferred_mcp_discovery_now() -> None:"""Run an armed deferred start immediately (idempotent, thread-safe)."""- with _mcp_discovery_lock:- timer = _mcp_discovery_deferred+ global _mcp_discovery_deferred+ with _mcp_discovery_lock: # take the slot atomically: two racing first clients fire once+ timer, _mcp_discovery_deferred = _mcp_discovery_deferred, Noneif timer is None:returntimer.cancel()