From e3f1bc7f77dbac92afb00d45fc58ff8c83024b5b Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Thu, 21 May 2026 22:41:13 +0000
Subject: [PATCH 1/2] Initial plan
From 96f9cd792c265f888377b42042aa83d14d269294 Mon Sep 17 00:00:00 2001
From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com>
Date: Thu, 21 May 2026 23:03:26 +0000
Subject: [PATCH 2/2] Align CLI path lookup order and Javadoc in TestUtil
Co-authored-by: edburns <75821+edburns@users.noreply.github.com>
---
.../java/com/github/copilot/sdk/TestUtil.java | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/test/java/com/github/copilot/sdk/TestUtil.java b/src/test/java/com/github/copilot/sdk/TestUtil.java
index d9462af87f..af44745901 100644
--- a/src/test/java/com/github/copilot/sdk/TestUtil.java
+++ b/src/test/java/com/github/copilot/sdk/TestUtil.java
@@ -36,9 +36,9 @@ public static String tempPath(String filename) {
*
* Resolution order:
*
- * - Search the system PATH using {@code where.exe} (Windows) or {@code which}
- * (Linux/macOS).
- * - Fall back to the {@code COPILOT_CLI_PATH} environment variable.
+ * - Use the {@code COPILOT_CLI_PATH} environment variable when set.
+ * - Otherwise search the system PATH using {@code where.exe} (Windows) or
+ * {@code which} (Linux/macOS).
* - Walk parent directories looking for
* {@code nodejs/node_modules/@github/copilot/index.js}.
*
@@ -55,16 +55,16 @@ public static String tempPath(String filename) {
* {@code null} if none was found
*/
static String findCliPath() {
- String copilotInPath = findCopilotInPath();
- if (copilotInPath != null) {
- return copilotInPath;
- }
-
String envPath = System.getenv("COPILOT_CLI_PATH");
if (envPath != null && !envPath.isEmpty()) {
return envPath;
}
+ String copilotInPath = findCopilotInPath();
+ if (copilotInPath != null) {
+ return copilotInPath;
+ }
+
Path current = Paths.get(System.getProperty("user.dir"));
while (current != null) {
Path cliPath = current.resolve("nodejs/node_modules/@github/copilot/index.js");