mcp: broaden reconnect retry, add per-server backoff, keep tools visible during reconnect - #15537
Conversation
…ble during reconnect
Contributor
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Aug 25, 2026
mcp: re-mint expired managed proxy tokens on demand instead of failing or misrouting to OAuth
#15538
Draft
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
ReconnectingPeerretried a failed tool call only onServiceError::TransportClosed. A failed streamable-HTTP POST surfaces asTransportSend(the worker keeps running), so the common failure mode was never retried.active_servers, so its tools vanished: tool calls failed with"MCP server for tool not found"and the UI tool list flickered empty.Changes
McpSelfHeal): a failed call retries once after reconnect when the error classifies asTransientorAuthExpiredRecoverableandis_safe_to_resendproves the request never executed. Resend safety is deliberately conservative: pre-execution rejections (401/403/408/429), connection failures, and broken pipes retry; 5xx-after-accept and response timeouts never do, so non-idempotent tools can't double-run.known_serversindex: tools/resources of every successfully connected server stay cached, so during reconnect windows (server retained inspawn_configsbut not active) the peer factories,tools()/resources()views,tool_input_schema, andserver_from_tool/resourcekeep working — the reconnect is triggered on use.Tests
Retry-decision tests (retry on re-mintable expiry, never on 5xx/timeout/user-fixable auth, flag-off = old behavior), breaker bookkeeping and fail-fast, known-server visibility lifecycle and flag-off inertness, plus new
is_safe_to_resendcoverage incargo test -p mcp.