Skip to content

Commit b35e9f6

Browse files
stephentoubCopilot
andcommitted
Include CLI stderr for stdio startup pipe failures
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 344b18f commit b35e9f6

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

dotnet/src/Client.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,6 +1154,17 @@ internal static async Task<T> InvokeRpcAsync<T>(JsonRpc rpc, string method, obje
11541154
}
11551155
throw new IOException($"Communication error with Copilot CLI: {ex.Message}", ex);
11561156
}
1157+
catch (IOException ex) when (stderrBuffer is not null)
1158+
{
1159+
var stderrOutput = await GetStderrOutputAsync(stderrBuffer, stderrReader);
1160+
1161+
if (!string.IsNullOrEmpty(stderrOutput))
1162+
{
1163+
throw new IOException(FormatCliExitedMessage("CLI process exited unexpectedly.", stderrOutput), ex);
1164+
}
1165+
1166+
throw;
1167+
}
11571168
catch (RemoteRpcException ex)
11581169
{
11591170
throw new IOException($"Communication error with Copilot CLI: {ex.Message}", ex);

0 commit comments

Comments
 (0)