Upstream Change
Upstream PR github/copilot-sdk#329 adds automatic hiding of the CLI console window on Windows when spawning the CLI subprocess. This prevents a distracting terminal window appearing in GUI applications.
Node.js change (nodejs/src/client.ts):
this.cliProcess = spawn(command, spawnArgs, {
stdio: ...,
cwd: this.options.cwd,
env: envWithoutNodeDebug,
windowsHide: true, // <-- added
});
Why Not Auto-Ported
The Clojure SDK uses Java's ProcessBuilder to spawn the CLI process (src/github/copilot_sdk/process.clj). Unlike Node.js's spawn which has a built-in windowsHide option, ProcessBuilder does not support hiding the Windows console window natively.
Options to port this to JVM:
-
JNA (Java Native Access) — Add a JNA dependency and call Windows CreateProcess directly with CREATE_NO_WINDOW. This adds a native dependency but works cleanly.
-
Reflection into ProcessImpl — Fragile, not recommended.
-
Accept as JVM limitation — Document that on Windows, a console window may briefly appear. The SDK primarily targets server-side use cases where this is less of a concern.
-
ProcessBuilder.inheritIO() + redirects — Doesn't help with window visibility.
Recommendation
If the Clojure SDK targets Windows GUI applications, option 1 (JNA) is the cleanest approach. Otherwise, document the limitation.
The relevant Clojure file to modify is src/github/copilot_sdk/process.clj, specifically the spawn-cli function (lines 29-88).
Affected Upstream Files
nodejs/src/client.ts — windowsHide: true in both stdio and TCP spawn calls
python/copilot/client.py — CREATE_NO_WINDOW flag on Windows
go/client.go + go/process_windows.go — platform-specific SysProcAttr.HideWindow
Testing
After implementing, verify that on Windows, no console window appears when using the SDK from a GUI application (e.g., a JavaFX or Swing app).
Generated by Upstream Sync Agent
Upstream Change
Upstream PR github/copilot-sdk#329 adds automatic hiding of the CLI console window on Windows when spawning the CLI subprocess. This prevents a distracting terminal window appearing in GUI applications.
Node.js change (
nodejs/src/client.ts):Why Not Auto-Ported
The Clojure SDK uses Java's
ProcessBuilderto spawn the CLI process (src/github/copilot_sdk/process.clj). Unlike Node.js'sspawnwhich has a built-inwindowsHideoption,ProcessBuilderdoes not support hiding the Windows console window natively.Options to port this to JVM:
JNA (Java Native Access) — Add a JNA dependency and call Windows
CreateProcessdirectly withCREATE_NO_WINDOW. This adds a native dependency but works cleanly.Reflection into
ProcessImpl— Fragile, not recommended.Accept as JVM limitation — Document that on Windows, a console window may briefly appear. The SDK primarily targets server-side use cases where this is less of a concern.
ProcessBuilder.inheritIO()+ redirects — Doesn't help with window visibility.Recommendation
If the Clojure SDK targets Windows GUI applications, option 1 (JNA) is the cleanest approach. Otherwise, document the limitation.
The relevant Clojure file to modify is
src/github/copilot_sdk/process.clj, specifically thespawn-clifunction (lines 29-88).Affected Upstream Files
nodejs/src/client.ts—windowsHide: truein both stdio and TCP spawn callspython/copilot/client.py—CREATE_NO_WINDOWflag on Windowsgo/client.go+go/process_windows.go— platform-specificSysProcAttr.HideWindowTesting
After implementing, verify that on Windows, no console window appears when using the SDK from a GUI application (e.g., a JavaFX or Swing app).