github / github/copilot-cli

Native copilot.exe binary silently exits with code 1 on Windows x64, npm-loader.js never falls back to JS implementation

未關閉
#1,566 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
area:platform-windows
主要語言
Shell
星號
11.2k
分支
1.9k
平均合併
14 小時 16 分鐘
30 天內合併 PR
6

描述

## Description

The native `copilot.exe` binary (both WinGet v0.0.410 and npm v0.0.412) silently exits with code 1 on Windows 11 x64, producing no stdout or stderr output. This makes the Copilot CLI completely unusable.

The `npm-loader.js` entrypoint unconditionally exits with the native binary's exit code (`process.exit(r.status??1)`), which prevents the JavaScript fallback (`index.js`) from ever being reached when the native binary fails.

## Steps to Reproduce

1. Install `@github/copilot` via npm (`npm install -g @github/copilot`) or WinGet (`winget install GitHub.Copilot`)
2. Run `copilot --version`
3. Binary exits with code 1, no output

## Expected Behavior

Either:
- The native binary should work correctly, OR
- `npm-loader.js` should fall back to the JS implementation when the native binary fails

## Actual Behavior

- `copilot.exe` exits with code 1, no stdout/stderr
- `npm-loader.js` calls `process.exit(r.status??1)` after `spawnSync`, so it exits with 1 without trying the JS fallback
- The JS implementation (`node index.js`) works perfectly

## Workaround

In `npm-loader.js`, change:
```
process.exit(r.status??1)
```
to:
```
if(r.status===0)process.exit(0)
```

This allows the JS fallback via `import("./index.js")` to run when the native binary fails.

## Environment

- **OS:** Windows 11 Enterprise 25H2 (Build 26200)
- **Architecture:** x64 (AMD64)
- **Node.js:** v25.6.1
- **npm:** 11.9.0
- **Copilot CLI (WinGet):** v0.0.410
- **Copilot CLI (npm):** 0.0.412
- **gh CLI:** 2.86.0

## Additional Context

- The native binary is a valid signed PE x64 executable (signature verified)
- `LoadLibraryEx` succeeds on the binary (no missing DLL dependencies)
- No Windows Defender blocks, no AppLocker policies, no Zone.Identifier ADS
- No crash dumps or WER reports generated
- The binary produces zero output to both stdout and stderr
- Running from any directory, any terminal (PowerShell, cmd), with or without admin privileges — same result

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。