Bug: Missing windowsHide:true on spawn() in client.ts
File: nodejs/src/client.ts lines 871-877
Verified: 100% confirmed via kernel trace. This is definitively in the SDK code, not the consuming application.
Current code
this.cliProcess = spawn(command, spawnArgs, {
stdio: this.options.useStdio
? ["pipe", "pipe", "pipe"]
: ["ignore", "pipe", "pipe"],
cwd: this.options.cwd,
env: envWithoutNodeDebug,
// windowsHide: true is MISSING
});
Impact
On Windows, every spawn() call without windowsHide: true causes the OS to allocate a new console (conhost.exe) that is visible on the desktop. Each window:
- Steals keyboard focus
- Disrupts z-order
- Flashes on screen
In a 20-second kernel trace of a copilot-ui session startup, 71 conhost.exe windows were created. The desktop becomes unusable -- the user cannot type because focus is constantly stolen.
Evidence
Kernel trace (ETW Process provider, 20-second capture):
- conhost.exe: 71 spawns
- cmd.exe: 10 spawns (from the related
cmd /c issue)
- All in Windows session 1 (interactive desktop)
Proposed fix
Add windowsHide: true to the spawn options:
this.cliProcess = spawn(command, spawnArgs, {
stdio: this.options.useStdio
? ["pipe", "pipe", "pipe"]
: ["ignore", "pipe", "pipe"],
cwd: this.options.cwd,
env: envWithoutNodeDebug,
windowsHide: true,
});
This is a one-line fix with zero behavioral change on non-Windows platforms (the flag is ignored on Linux/macOS).
Note
This fork issue tracks a fix for jagilber/copilot-sdk. The consuming app (copilot-ui) is new code and many of the overall visibility problems may be self-inflicted, but this specific spawn site is 100% verified to be missing the flag in the SDK itself.
Bug: Missing windowsHide:true on spawn() in client.ts
File:
nodejs/src/client.tslines 871-877Verified: 100% confirmed via kernel trace. This is definitively in the SDK code, not the consuming application.
Current code
Impact
On Windows, every
spawn()call withoutwindowsHide: truecauses the OS to allocate a new console (conhost.exe) that is visible on the desktop. Each window:In a 20-second kernel trace of a copilot-ui session startup, 71 conhost.exe windows were created. The desktop becomes unusable -- the user cannot type because focus is constantly stolen.
Evidence
Kernel trace (ETW Process provider, 20-second capture):
cmd /cissue)Proposed fix
Add
windowsHide: trueto the spawn options:This is a one-line fix with zero behavioral change on non-Windows platforms (the flag is ignored on Linux/macOS).
Note
This fork issue tracks a fix for
jagilber/copilot-sdk. The consuming app (copilot-ui) is new code and many of the overall visibility problems may be self-inflicted, but this specific spawn site is 100% verified to be missing the flag in the SDK itself.