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>
This commit is contained in:
David Kaya
2026-03-22 16:50:44 +01:00
co-authored by Copilot
parent 312ca0bf17
commit 64a987b48a
@@ -298,6 +298,7 @@ internal static partial class CopilotConnectionMetadataResolver
throw new InvalidOperationException($"Failed to start command '{executablePath}'.");
}
process.StandardInput.Close();
Task<string> standardOutputTask = process.StandardOutput.ReadToEndAsync(timeoutSource.Token);
Task<string> 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,