We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b988c55 commit ea81206Copy full SHA for ea81206
1 file changed
src/main/java/com/github/copilot/sdk/CopilotSession.java
@@ -239,8 +239,12 @@ public CompletableFuture<AssistantMessageEvent> sendAndWait(MessageOptions optio
239
return null;
240
});
241
242
- // Set up timeout
243
- ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor();
+ // Set up timeout with daemon thread so it doesn't prevent JVM exit
+ ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor(r -> {
244
+ Thread t = new Thread(r, "sendAndWait-timeout");
245
+ t.setDaemon(true);
246
+ return t;
247
+ });
248
scheduler.schedule(() -> {
249
if (!future.isDone()) {
250
future.completeExceptionally(new TimeoutException("sendAndWait timed out after " + timeoutMs + "ms"));
0 commit comments