Skip to content

Commit 8d0a9cc

Browse files
github-actions[bot]stephentoubCopilot
authored
Update @github/copilot to 1.0.79-9 (#2299)
* Update @github/copilot to 1.0.79-9 - Updated nodejs and test harness dependencies - Re-ran code generators - Formatted generated code * Fix factory run listing after CLI update Pass the generated RPC client's required paging request while preserving the SDK's existing listRuns API and wire behavior. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> * Bound in-process .NET test cleanup Fall back to ForceStopAsync when graceful in-process fixture cleanup stalls so a hung session.destroy cannot hold the macOS runner indefinitely. Cover the concurrent graceful/forced shutdown path with a lifetime regression test. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 781f5380-c114-40eb-a599-378b3f15cbea * Stabilize .NET CLI startup error test Use a deterministic failing JavaScript CLI fixture instead of relying on the bundled CLI to parse an invalid flag within the TCP startup timeout on loaded Windows runners. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 781f5380-c114-40eb-a599-378b3f15cbea --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Stephen Toub <stoub@microsoft.com> Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 781f5380-c114-40eb-a599-378b3f15cbea
1 parent 243ca39 commit 8d0a9cc

31 files changed

Lines changed: 712 additions & 303 deletions

dotnet/src/Generated/Rpc.cs

Lines changed: 97 additions & 104 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dotnet/src/Generated/SessionEvents.cs

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dotnet/test/E2E/ClientE2ETests.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ namespace GitHub.Copilot.Test.E2E;
1111
// Other test classes should instead inherit from E2ETestBase
1212
public class ClientE2ETests(E2ETestFixture fixture) : IClassFixture<E2ETestFixture>
1313
{
14+
private const string FailingCliScript =
15+
"process.stderr.write('nonexistent test flag on stderr\\n'); process.exit(1);";
16+
1417
private E2ETestContext Ctx => fixture.Ctx;
1518

1619
[Theory]
@@ -177,11 +180,14 @@ public async Task Should_Not_Throw_When_Disposing_Session_After_Stopping_Client(
177180
[InlineData(false)] // TCP transport
178181
public async Task Should_Report_Error_With_Stderr_When_CLI_Fails_To_Start(bool useStdio)
179182
{
183+
var cliPath = Path.Join(Ctx.WorkDir, $"failing-cli-{Guid.NewGuid():N}.js");
184+
await File.WriteAllTextAsync(cliPath, FailingCliScript);
185+
180186
var client = new CopilotClient(new CopilotClientOptions
181187
{
182188
Connection = useStdio
183-
? RuntimeConnection.ForStdio(args: ["--nonexistent-flag-for-testing"])
184-
: RuntimeConnection.ForTcp(args: ["--nonexistent-flag-for-testing"])
189+
? RuntimeConnection.ForStdio(path: cliPath)
190+
: RuntimeConnection.ForTcp(path: cliPath)
185191
});
186192

187193
var ex = await Assert.ThrowsAsync<IOException>(() => client.StartAsync());

dotnet/test/Harness/E2ETestContext.cs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ namespace GitHub.Copilot.Test.Harness;
1313
public sealed class E2ETestContext : IAsyncDisposable
1414
{
1515
private const string DefaultGitHubToken = "fake-token-for-e2e-tests";
16+
private static readonly TimeSpan s_gracefulClientStopTimeout = TimeSpan.FromSeconds(30);
1617

1718
public string HomeDir { get; }
1819
public string WorkDir { get; }
@@ -549,7 +550,6 @@ private static bool IsInProcess(RuntimeConnection? connection)
549550
return false;
550551
}
551552

552-
// Inproc holds the session-store SQLite handle in-process; graceful StopAsync releases it so the temp-dir delete succeeds on Windows.
553553
private static async Task StopClientForCleanupAsync(CopilotClient client)
554554
{
555555
var isInProcess = string.Equals(
@@ -558,7 +558,21 @@ private static async Task StopClientForCleanupAsync(CopilotClient client)
558558
StringComparison.OrdinalIgnoreCase);
559559
if (isInProcess)
560560
{
561-
await client.StopAsync();
561+
var gracefulStop = client.StopAsync();
562+
try
563+
{
564+
await gracefulStop.WaitAsync(s_gracefulClientStopTimeout);
565+
}
566+
catch (TimeoutException)
567+
{
568+
Console.Error.WriteLine(
569+
$"Graceful in-process client cleanup exceeded {s_gracefulClientStopTimeout}; forcing shutdown.");
570+
await client.ForceStopAsync();
571+
572+
// Disposing the connection completes any session.destroy RPC that
573+
// blocked graceful cleanup. Observe that task before continuing.
574+
await gracefulStop.WaitAsync(s_gracefulClientStopTimeout);
575+
}
562576
}
563577
else
564578
{

dotnet/test/Unit/ClientSessionLifetimeTests.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,27 @@ public async Task StopAsync_Keeps_Session_Rooted_Until_Destroy_Completes()
183183
AssertSessionCount(client, sessions: 0);
184184
}
185185

186+
[Fact]
187+
public async Task ForceStopAsync_Unblocks_StopAsync_When_Session_Destroy_Hangs()
188+
{
189+
await using var server = await FakeCopilotServer.StartAsync();
190+
server.DelayDestroy();
191+
await using var client = new CopilotClient(new CopilotClientOptions { Connection = RuntimeConnection.ForUri(server.Url) });
192+
193+
_ = await client.CreateSessionAsync(new SessionConfig
194+
{
195+
OnPermissionRequest = PermissionHandler.ApproveAll
196+
});
197+
198+
var stopTask = client.StopAsync();
199+
await server.DestroyStarted;
200+
201+
await client.ForceStopAsync();
202+
await stopTask.WaitAsync(TimeSpan.FromSeconds(5));
203+
204+
AssertSessionCount(client, sessions: 0);
205+
}
206+
186207
[Fact]
187208
public async Task ResumeSessionAsync_Throws_When_Same_Client_Already_Tracks_Session()
188209
{

go/rpc/zrpc.go

Lines changed: 72 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/rpc/zrpc_encoding.go

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/rpc/zsession_events.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

java/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
DO NOT EDIT MANUALLY. Updated by the update-copilot-dependency
8989
workflow.
9090
-->
91-
<readonly-copilot-sdk-ref-impl-version-from-lastmerge-file-updated-by-reference-impl-sync>^1.0.79-6</readonly-copilot-sdk-ref-impl-version-from-lastmerge-file-updated-by-reference-impl-sync>
91+
<readonly-copilot-sdk-ref-impl-version-from-lastmerge-file-updated-by-reference-impl-sync>^1.0.79-9</readonly-copilot-sdk-ref-impl-version-from-lastmerge-file-updated-by-reference-impl-sync>
9292

9393
</properties>
9494

0 commit comments

Comments
 (0)