Skip to content

Commit 412690a

Browse files
committed
Small updates to Quick Start for better automated testing
1 parent c0d8668 commit 412690a

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ import java.util.concurrent.CompletableFuture;
7373

7474
public class CopilotSDK {
7575
public static void main(String[] args) throws Exception {
76+
var lastMessage = new String[]{null};
77+
7678
// Create and start client
7779
try (var client = new CopilotClient()) {
7880
client.start().get();
@@ -81,9 +83,11 @@ public class CopilotSDK {
8183
var session = client.createSession(
8284
new SessionConfig().setOnPermissionRequest(PermissionHandler.APPROVE_ALL).setModel("claude-sonnet-4.5")).get();
8385

86+
8487
// Handle assistant message events
8588
session.on(AssistantMessageEvent.class, msg -> {
86-
System.out.println(msg.getData().content());
89+
lastMessage[0] = msg.getData().content();
90+
System.out.println(lastMessage[0]);
8791
});
8892

8993
// Handle session usage info events
@@ -100,6 +104,9 @@ public class CopilotSDK {
100104
// and wait for completion
101105
completable.get();
102106
}
107+
108+
boolean success = lastMessage[0] != null && lastMessage[0].contains("4");
109+
System.exit(success ? 0 : -1);
103110
}
104111
}
105112
```

0 commit comments

Comments
 (0)