From 48c85f02bf7dc53006dc299124083116da7b0776 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 17 Oct 2026 18:52:26 +0000 Subject: [PATCH 1/2] Initial plan From 4258986554df70f86d971e745c4bb680bd36e66a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 17 Oct 2026 18:58:22 +0000 Subject: [PATCH 2/2] Bound stdio process-exit wait Co-authored-by: halter73 <54385+halter73@users.noreply.github.com> --- .../Client/StdioClientSessionTransport.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ModelContextProtocol.Core/Client/StdioClientSessionTransport.cs b/src/ModelContextProtocol.Core/Client/StdioClientSessionTransport.cs index bb446af55..6e9a947ed 100644 --- a/src/ModelContextProtocol.Core/Client/StdioClientSessionTransport.cs +++ b/src/ModelContextProtocol.Core/Client/StdioClientSessionTransport.cs @@ -160,7 +160,10 @@ private async ValueTask WaitForProcessExitAsync() { #if NET using var timeoutCts = new CancellationTokenSource(_options.ShutdownTimeout); - await _process.WaitForExitAsync(timeoutCts.Token).ConfigureAwait(false); + // Keep shutdown bounded even if waiting for redirected output does not observe cancellation. + await _process.WaitForExitAsync(timeoutCts.Token) + .WaitAsync(_options.ShutdownTimeout) + .ConfigureAwait(false); #else if (_process.WaitForExit((int)_options.ShutdownTimeout.TotalMilliseconds)) {