From 64a987b48a0b3425b8110a6d1c102dd3df8ff1cc Mon Sep 17 00:00:00 2001 From: David Kaya Date: Sun, 22 Mar 2026 16:50:44 +0100 Subject: [PATCH] fix: close stdin for sidecar subprocess probes Redirect and immediately close stdin for sidecar-spawned CLI subprocesses so they do not inherit the long-lived stdio pipe from the Electron/Node host. This fixes the Copilot version probe timing out under the actual app runtime while preserving the direct CLI and account diagnostics behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Services/CopilotConnectionMetadataResolver.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sidecar/src/Kopaya.AgentHost/Services/CopilotConnectionMetadataResolver.cs b/sidecar/src/Kopaya.AgentHost/Services/CopilotConnectionMetadataResolver.cs index 06b9ce4..e1fd72a 100644 --- a/sidecar/src/Kopaya.AgentHost/Services/CopilotConnectionMetadataResolver.cs +++ b/sidecar/src/Kopaya.AgentHost/Services/CopilotConnectionMetadataResolver.cs @@ -298,6 +298,7 @@ internal static partial class CopilotConnectionMetadataResolver throw new InvalidOperationException($"Failed to start command '{executablePath}'."); } + process.StandardInput.Close(); Task standardOutputTask = process.StandardOutput.ReadToEndAsync(timeoutSource.Token); Task standardErrorTask = process.StandardError.ReadToEndAsync(timeoutSource.Token); @@ -318,6 +319,7 @@ internal static partial class CopilotConnectionMetadataResolver { RedirectStandardOutput = true, RedirectStandardError = true, + RedirectStandardInput = true, UseShellExecute = false, CreateNoWindow = true, StandardOutputEncoding = Encoding.UTF8,