2525import com .github .copilot .sdk .json .CopilotClientOptions ;
2626import com .github .copilot .sdk .json .MessageOptions ;
2727import com .github .copilot .sdk .json .PermissionHandler ;
28- import com .github .copilot .sdk .json .PermissionRequest ;
2928import com .github .copilot .sdk .json .PermissionRequestResult ;
3029import com .github .copilot .sdk .json .PreToolUseHookOutput ;
3130import com .github .copilot .sdk .json .SessionConfig ;
@@ -62,8 +61,8 @@ static void teardown() throws Exception {
6261 }
6362
6463 /**
65- * A decorator executor that delegates to a real executor while counting
66- * task submissions.
64+ * A decorator executor that delegates to a real executor while counting task
65+ * submissions.
6766 */
6867 static class TrackingExecutor implements Executor {
6968
@@ -101,8 +100,8 @@ private CopilotClientOptions createOptionsWithExecutor(TrackingExecutor executor
101100 *
102101 * <p>
103102 * {@code CopilotClient.startCore()} uses
104- * {@code CompletableFuture.supplyAsync(...)} to initialize the connection.
105- * This test asserts that the start-up task goes through the caller-supplied
103+ * {@code CompletableFuture.supplyAsync(...)} to initialize the connection. This
104+ * test asserts that the start-up task goes through the caller-supplied
106105 * executor, not {@code ForkJoinPool.commonPool()}.
107106 * </p>
108107 *
@@ -129,9 +128,8 @@ void testClientStartUsesProvidedExecutor() throws Exception {
129128 * Verifies that tool call dispatch routes through the provided executor.
130129 *
131130 * <p>
132- * When a custom tool is invoked by the LLM, the
133- * {@code RpcHandlerDispatcher} calls
134- * {@code CompletableFuture.runAsync(...)} to dispatch the tool handler.
131+ * When a custom tool is invoked by the LLM, the {@code RpcHandlerDispatcher}
132+ * calls {@code CompletableFuture.runAsync(...)} to dispatch the tool handler.
135133 * This test asserts that dispatch goes through the caller-supplied executor.
136134 * </p>
137135 *
@@ -187,10 +185,9 @@ void testToolCallDispatchUsesProvidedExecutor() throws Exception {
187185 * executor.
188186 *
189187 * <p>
190- * When the LLM requests a permission, the {@code RpcHandlerDispatcher}
191- * calls {@code CompletableFuture.runAsync(...)} to dispatch the permission
192- * handler. This test asserts that dispatch goes through the caller-supplied
193- * executor.
188+ * When the LLM requests a permission, the {@code RpcHandlerDispatcher} calls
189+ * {@code CompletableFuture.runAsync(...)} to dispatch the permission handler.
190+ * This test asserts that dispatch goes through the caller-supplied executor.
194191 * </p>
195192 *
196193 * @see Snapshot: permissions/permission_handler_for_write_operations
@@ -212,8 +209,7 @@ void testPermissionDispatchUsesProvidedExecutor() throws Exception {
212209
213210 int beforeSend = trackingExecutor .getTaskCount ();
214211
215- session .sendAndWait (
216- new MessageOptions ().setPrompt ("Edit test.txt and replace 'original' with 'modified'" ))
212+ session .sendAndWait (new MessageOptions ().setPrompt ("Edit test.txt and replace 'original' with 'modified'" ))
217213 .get (60 , TimeUnit .SECONDS );
218214
219215 assertTrue (trackingExecutor .getTaskCount () > beforeSend ,
@@ -231,9 +227,8 @@ void testPermissionDispatchUsesProvidedExecutor() throws Exception {
231227 *
232228 * <p>
233229 * When the LLM asks for user input, the {@code RpcHandlerDispatcher} calls
234- * {@code CompletableFuture.runAsync(...)} to dispatch the user input
235- * handler. This test asserts that dispatch goes through the caller-supplied
236- * executor.
230+ * {@code CompletableFuture.runAsync(...)} to dispatch the user input handler.
231+ * This test asserts that dispatch goes through the caller-supplied executor.
237232 * </p>
238233 *
239234 * @see Snapshot:
@@ -278,8 +273,8 @@ void testUserInputDispatchUsesProvidedExecutor() throws Exception {
278273 *
279274 * <p>
280275 * When the LLM triggers a hook, the {@code RpcHandlerDispatcher} calls
281- * {@code CompletableFuture.runAsync(...)} to dispatch the hooks handler.
282- * This test asserts that dispatch goes through the caller-supplied executor.
276+ * {@code CompletableFuture.runAsync(...)} to dispatch the hooks handler. This
277+ * test asserts that dispatch goes through the caller-supplied executor.
283278 * </p>
284279 *
285280 * @see Snapshot: hooks/invoke_pre_tool_use_hook_when_model_runs_a_tool
@@ -316,14 +311,13 @@ void testHooksDispatchUsesProvidedExecutor() throws Exception {
316311 }
317312
318313 /**
319- * Verifies that {@code CopilotClient.stop()} routes session closure through
320- * the provided executor.
314+ * Verifies that {@code CopilotClient.stop()} routes session closure through the
315+ * provided executor.
321316 *
322317 * <p>
323- * {@code CopilotClient.stop()} uses
324- * {@code CompletableFuture.runAsync(...)} to close each active session.
325- * This test asserts that those closures go through the caller-supplied
326- * executor.
318+ * {@code CopilotClient.stop()} uses {@code CompletableFuture.runAsync(...)} to
319+ * close each active session. This test asserts that those closures go through
320+ * the caller-supplied executor.
327321 * </p>
328322 *
329323 * @see Snapshot: tools/invokes_custom_tool
0 commit comments