From e27f282025e80e91b00dffa67eb504ae38fdf370 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 15:59:09 +0000 Subject: [PATCH 1/3] Initial plan From 1796f4c571218c30b7cef951f4ffa8fd47a9da8f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 16:06:11 +0000 Subject: [PATCH 2/3] Add test for closing session after client stops Co-authored-by: brunoborges <129743+brunoborges@users.noreply.github.com> --- .../github/copilot/sdk/CopilotClientTest.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/test/java/com/github/copilot/sdk/CopilotClientTest.java b/src/test/java/com/github/copilot/sdk/CopilotClientTest.java index 05e7290b3..1dde9fd01 100644 --- a/src/test/java/com/github/copilot/sdk/CopilotClientTest.java +++ b/src/test/java/com/github/copilot/sdk/CopilotClientTest.java @@ -424,6 +424,28 @@ void testForceStopWithNoConnectionCompletes() throws Exception { } } + @Test + void testCloseSessionAfterStoppingClientDoesNotThrow() throws Exception { + if (cliPath == null) { + System.out.println("Skipping test: CLI not found"); + return; + } + + try (var client = new CopilotClient(new CopilotClientOptions().setCliPath(cliPath))) { + var session = client.createSession().get(); + + // Stop the client first (which closes the RPC connection) + client.stop().get(); + + // Then close the session - should not throw even though RPC is closed + assertDoesNotThrow(() -> session.close(), "Closing session after client.stop() should not throw exception"); + + // Verify session is terminated + assertThrows(IllegalStateException.class, () -> session.send("test"), + "Session should be terminated after close()"); + } + } + // ===== start() idempotency ===== @Test From 4a84ca9924ef816f963d9cdd53a3f5ee9638f94f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 16:06:28 +0000 Subject: [PATCH 3/3] Update .lastmerge to 304d812 Co-authored-by: brunoborges <129743+brunoborges@users.noreply.github.com> --- .lastmerge | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.lastmerge b/.lastmerge index 6d9098bab..04846a767 100644 --- a/.lastmerge +++ b/.lastmerge @@ -1 +1 @@ -e40d57c86e18b495722adbf42045288c03924342 +304d812cd4c98755159da427c6701bfb7e0b7c32