Skip to content

fix(mcp): keep tool errors out of server breaker - #79645

Closed
Muhtasham wants to merge 1 commit into
NousResearch:mainfrom
Muhtasham:fix/mcp-application-errors-breaker
Closed

fix(mcp): keep tool errors out of server breaker#79645
Muhtasham wants to merge 1 commit into
NousResearch:mainfrom
Muhtasham:fix/mcp-application-errors-breaker

Conversation

@Muhtasham

Copy link
Copy Markdown

Problem

Repeated CallToolResult.isError responses currently increment the server-wide MCP circuit breaker. Invalid arguments or missing resources can therefore block neighboring valid tools even though every RPC proved the transport healthy.

Fix

Reset server-health breaker state after every completed MCP RPC. Tool-level errors remain unchanged and visible to the caller; transport/session exceptions continue to drive the breaker.

Verification

  • Reproduced on current main: the fourth application rejection was replaced by a server-unreachable error
  • Added an invariant test proving repeated application errors remain visible without opening the breaker
  • scripts/run_tests.sh tests/tools/test_mcp_circuit_breaker.py tests/tools/test_mcp_tool.py tests/tools/test_mcp_tool_session_expired.py -q — 111 passed
  • Ruff check — passed
  • git diff --check — passed

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/tools Tool registry, model_tools, toolsets tool/mcp MCP client and OAuth sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades duplicate This issue or pull request already exists labels Aug 5, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Duplicate of #74045. It implements the same completed-RPC breaker reset, while #74045 additionally covers the auth and session-recovery paths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/tools Tool registry, model_tools, toolsets duplicate This issue or pull request already exists P2 Medium — degraded but workaround exists sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades tool/mcp MCP client and OAuth type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants