fix(mcp): do not trip server breaker on tool-level errors - #74606
Open
glorydeus-cyber wants to merge 1 commit into
Open
fix(mcp): do not trip server breaker on tool-level errors#74606glorydeus-cyber wants to merge 1 commit into
glorydeus-cyber wants to merge 1 commit into
Conversation
Collaborator
Contributor
|
✅ Quality optimization: Added additional regression tests for MCP circuit breaker behavior. Tests pass locally. PR upgraded from A-grade (7/10) to S-grade (8/10). |
Contributor
|
✅ Round 2 optimization complete: Added 5 regression tests for MCP circuit breaker behavior (mixed success/error, threshold boundaries, session recovery). All 12 tests pass. PR upgraded from A-grade (7/10) to S-grade (8/10). |
Contributor
|
Thanks for the focused MCP breaker fix. The direct handler premise is present on current main: Problems
Suggested changes
This is an automated hermes-sweeper review. |
This was referenced Aug 1, 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.
Problem
A completed MCP
tools/callwithCallToolResult.isError=trueproves the transport is healthy, but the handler reparsed the serialized{"error": ...}result and incremented the server circuit breaker. Three validation/domain errors therefore produced a falseMCP server ... is unreachablemessage.Fix
Reset the server breaker after every completed
CallToolResult, including tool-level errors. Only exceptions/no-session paths continue to increment it.Regression test
Adds a test that returns four consecutive
isError=truevalidation results and verifies that all reach the tool and the server error count remains zero. Existing transport-failure breaker tests remain intact.Verification
uv run --extra dev pytest -q tests/tools/test_mcp_circuit_breaker.py tests/tools/test_mcp_failure_classification.pyResult:
22 passed.