Skip to content

Commit ce4fd3d

Browse files
Copilotbrunoborges
andauthored
Address code review feedback: use assertFalse, simplify README
Agent-Logs-Url: https://github.com/github/copilot-sdk-java/sessions/e74714e4-bb84-4af7-b1ef-44f576c5b37c Co-authored-by: brunoborges <129743+brunoborges@users.noreply.github.com>
1 parent 4ae4200 commit ce4fd3d

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

README.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Java SDK for programmatic control of GitHub Copilot CLI, enabling you to build A
2424

2525
### Requirements
2626

27-
- Java 17 or later. **JDK 21+ recommended** for automatic virtual thread support (see [Virtual Threads](#virtual-threads) below). Selecting JDK 25 additionally enables the use of virtual threads for the custom executor, as shown in the [Quick Start](#quick-start).
27+
- Java 17 or later. **JDK 21+ recommended** — the SDK automatically uses virtual threads for its internal I/O on Java 21+ (see [Virtual Threads](#virtual-threads)).
2828
- GitHub Copilot CLI 1.0.17 or later installed and in `PATH` (or provide custom `cliPath`)
2929

3030
### Maven
@@ -69,23 +69,17 @@ implementation 'com.github:copilot-sdk-java:0.2.1-java.1'
6969
import com.github.copilot.sdk.CopilotClient;
7070
import com.github.copilot.sdk.events.AssistantMessageEvent;
7171
import com.github.copilot.sdk.events.SessionUsageInfoEvent;
72-
import com.github.copilot.sdk.json.CopilotClientOptions;
7372
import com.github.copilot.sdk.json.MessageOptions;
7473
import com.github.copilot.sdk.json.PermissionHandler;
7574
import com.github.copilot.sdk.json.SessionConfig;
7675

77-
import java.util.concurrent.Executors;
78-
7976
public class CopilotSDK {
8077
public static void main(String[] args) throws Exception {
8178
var lastMessage = new String[]{null};
8279

8380
// Create and start client
84-
try (var client = new CopilotClient()) { // JDK 25+: comment out this line
85-
// JDK 25+: uncomment the following 3 lines for virtual thread support
86-
// var options = new CopilotClientOptions()
87-
// .setExecutor(Executors.newVirtualThreadPerTaskExecutor());
88-
// try (var client = new CopilotClient(options)) {
81+
// On Java 21+, the SDK automatically uses virtual threads for internal I/O.
82+
try (var client = new CopilotClient()) {
8983
client.start().get();
9084

9185
// Create a session

src/test/java/com/github/copilot/sdk/ThreadFactoryProviderTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
package com.github.copilot.sdk;
66

77
import static org.junit.jupiter.api.Assertions.assertEquals;
8+
import static org.junit.jupiter.api.Assertions.assertFalse;
89
import static org.junit.jupiter.api.Assertions.assertNotNull;
910
import static org.junit.jupiter.api.Assertions.assertTrue;
1011

@@ -56,7 +57,7 @@ void isVirtualThreadsReturnsBoolean() {
5657
if (javaVersion >= 21) {
5758
assertTrue(result, "Expected virtual threads on Java 21+");
5859
} else {
59-
assertTrue(!result, "Expected platform threads on Java < 21");
60+
assertFalse(result, "Expected platform threads on Java < 21");
6061
}
6162
}
6263
}

0 commit comments

Comments
 (0)