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 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
62/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
javascript, nodejs
领域
cli

调研方向

从 npm-loader.js 中的 spawnSync 调用开始,将其失败路径与 import index.js 进行比较。在 Windows x64 上使用会失败的原生可执行文件运行 copilot --version,然后验证当原生进程以非零退出代码结束时,JavaScript 实现会运行并返回其结果。

由索引模型根据 Issue 内容生成。

描述

area:platform-windows

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
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

github/copilot-cli 的其他 Issue

查看 github/copilot-cli 的全部 Issue

相似的 Issue

更多 Shell/Bash Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。