From 58ae656c7e6e31cdb558a07d7b1475af4b55cf4e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 22 Feb 2026 02:11:21 +0000 Subject: [PATCH 1/2] Initial plan From 62064ef970b624e76cd23474086d210e5fba2574 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 22 Feb 2026 02:12:58 +0000 Subject: [PATCH 2/2] Increase MaxReconnectionAttempts default from 2 to 5 Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com> --- .../Client/HttpClientTransportOptions.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ModelContextProtocol.Core/Client/HttpClientTransportOptions.cs b/src/ModelContextProtocol.Core/Client/HttpClientTransportOptions.cs index 73eaae700..ce61849e0 100644 --- a/src/ModelContextProtocol.Core/Client/HttpClientTransportOptions.cs +++ b/src/ModelContextProtocol.Core/Client/HttpClientTransportOptions.cs @@ -113,14 +113,15 @@ public required Uri Endpoint /// Gets or sets the maximum number of consecutive reconnection attempts when an SSE stream is disconnected. /// /// - /// The maximum number of reconnection attempts. The default is 2. + /// The maximum number of reconnection attempts. The default is 5. /// /// /// When an SSE stream is disconnected (e.g., due to a network issue), the client will attempt to /// reconnect using the Last-Event-ID header to resume from where it left off. This property controls - /// how many reconnection attempts are made before giving up. + /// how many consecutive reconnection attempts are made before giving up. The counter resets to zero + /// on each successful stream read, so this value only limits consecutive failures. /// - public int MaxReconnectionAttempts { get; set; } = 2; + public int MaxReconnectionAttempts { get; set; } = 5; /// /// Gets or sets the default interval at which the client attempts reconnection after an SSE stream is disconnected.