fix(mcp): respect HERMES_MCP_DISCOVERY_TIMEOUT env var for slow-connecting servers - #37393
Closed
arimu1 wants to merge 1 commit into
Closed
fix(mcp): respect HERMES_MCP_DISCOVERY_TIMEOUT env var for slow-connecting servers#37393arimu1 wants to merge 1 commit into
arimu1 wants to merge 1 commit into
Conversation
…cting servers Closes NousResearch#37013
arimu1
force-pushed
the
fix/mcp-discovery-timeout-env-var
branch
from
July 11, 2026 03:06
ae00bb1 to
c701dde
Compare
Contributor
|
Thanks for isolating the slow-MCP startup case and adding focused resolver tests. This automated hermes-sweeper review is closing this as
For a longer initial wait, configure Closed as not-planned per standing maintainer policy ( |
This was referenced Aug 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
hermes -z(headless oneshot) snapshots its MCP tool list once after only 0.75 s, so any MCP server with a real process startup (Docker, stdio) is silently absent for the entire session — no error, no warning.HERMES_MCP_DISCOVERY_TIMEOUTenvironment variable that overrides the discovery wait, giving users with slow servers a zero-config-schema escape hatch.Root Cause
wait_for_mcp_discovery(timeout: float = 0.75)inhermes_cli/mcp_startup.pyis called with no argument at bothcli.py:793andcli.py:4937. The 0.75 s default predates process-backed MCP servers. In headless mode the tool list is snapshotted once at startup and never refreshed.Fix
wait_for_mcp_discoverynow readsHERMES_MCP_DISCOVERY_TIMEOUT(float seconds) from the environment and uses it as the effective timeout when present. The existing 0.75 s default is preserved as the fallback — no call sites change, no config schema changes.HERMES_MCP_DISCOVERY_TIMEOUT=10 hermes -z "call my-docker-tool and summarise the result"Test Plan
hermes -z "list available tools"without the env var omits the server's tools (reproduces [Bug]: -z/headless oneshots silently drop slow-connecting MCP servers (0.75 s discovery wait too short for container/stdio-backed servers) #37013).HERMES_MCP_DISCOVERY_TIMEOUT=10 hermes -z "list available tools"includes the server's tools.hermes(no-z) is unaffected.HERMES_MCP_DISCOVERY_TIMEOUT=abc) silently falls back to 0.75 s.Closes #37013