Skip to content

fix(mcp): resolve tool-call timeouts via the unified deadline layer (#85125 2g) - #93830

Merged
kshitijk4poor merged 1 commit into
NousResearch:mainfrom
kshitijk4poor:fix/85125-2g-mcp-timeout-resolution
Aug 24, 2026
Merged

kshitijk4poor merged 1 commit into
NousResearch:mainfrom
kshitijk4poor:fix/85125-2g-mcp-timeout-resolution

Conversation

@kshitijk4poor

Copy link
Copy Markdown
Contributor

#85125 Phase 2g. Both readers of the per-server MCP tool-call timeout — the connection's run() (self.tool_timeout) and the cache-path tool registration — each did their own private config.get("timeout", 300). They now route through one _resolve_tool_timeout helper wired to the unified deadline layer.

Documented precedence (most specific wins):

  1. mcp_servers.<name>.timeout — per-server config, always wins (unchanged)
  2. timeouts.mcp.tool_call — the unified timeouts: section (feat(agent): unified deadline layer — bounded execution primitive + timeout resolver (#85125 Phase 1) #85147)
  3. the historical 300s default (unchanged)

Values resolved through the section pass resolve_timeout's platform clamp; a failed resolution falls back to the historical default. No default changes — with nothing configured every resolved value equals today's, pinned by contract tests per the tracker's regression policy (rule 1).

Verification

  • New tests/tools/test_mcp_timeout_resolution.py: 5 contract tests (default invariance, per-server-beats-section, section-beats-default, invalid-value fallback, resolution-failure fallback)
  • Full MCP test sweep (tests/tools/ -k mcp): 639 passed
  • ruff clean; no new env vars; no cache impact

Part of #85125 (Phase 2g).

…ousResearch#85125 2g)

Both readers of the per-server MCP tool timeout (the connection's run()
and the cache-path registration) read config.get("timeout", 300) as
their own private resolution. Route them through _resolve_tool_timeout:
per-server mcp_servers.<name>.timeout still ALWAYS wins (most specific),
then timeouts.mcp.tool_call from the unified timeouts: section, then
the unchanged 300s default. Values pass through resolve_timeout's
platform clamp; resolution failure falls back to the historical default.

Default-behavior invariance pinned by contract tests (nothing
configured -> exactly 300, per-server beats section, section beats
default, invalid/failed resolution falls back).
@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have tool/mcp MCP client and OAuth sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades labels Aug 24, 2026
@kshitijk4poor
kshitijk4poor merged commit 057dcdf into NousResearch:main Aug 24, 2026
39 checks passed
melon-xf added a commit to melon-xf/hermes-agent that referenced this pull request Sep 3, 2026
…-mcp-timeout-resolution

fix(mcp): resolve tool-call timeouts via the unified deadline layer (NousResearch#85125 2g)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low — cosmetic, nice to have sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades tool/mcp MCP client and OAuth type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants