github / github/copilot-cli

Windows: plugin install/update fails with "Access is denied. (os error 5)" while VS Code is running

未关闭
#4,570 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

area:platform-windows area:plugins
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

On Windows, copilot plugin install / plugin update fails whenever VS Code is running. Closing VS Code makes the same command succeed. It affects every plugin, not one specific plugin.

Repro

With VS Code open:

> copilot plugin update superpowers@superpowers-marketplace
Failed to update plugin: Error: Request plugins.update failed with message: Failed to install plugin: Access is denied. (os error 5)

Close VS Code, run the same command again -> succeeds.

Cause: open directory handles on the plugin store

On Windows a directory that has an open handle cannot be renamed or deleted. Probing which paths can be renamed:

rename DENIED: ~/.copilot/installed-plugins
rename DENIED: ~/.copilot/installed-plugins/superpowers-marketplace
rename DENIED: ~/.copilot/installed-plugins/superpowers-marketplace/superpowers
rename OK    : ~/.copilot/installed-plugins/superpowers-marketplace/superpowers/skills

creating and deleting a file inside those directories: OK

The denied set is exactly the store root, the marketplace root and the plugin root. One level deeper is free, and file I/O inside them works normally. That is the signature of one open directory handle per plugin root, opened without FILE_SHARE_DELETE, so the install/update step that replaces a plugin directory gets ACCESS_DENIED.

Worth noting for anyone else debugging this: Restart Manager reports no holders for any file under installed-plugins, because these are directory handles rather than file handles. The usual "which process has this file open" tooling shows nothing.

VS Code ships its own copy of the CLI (resources/app/node_modules.asar.unpacked/@github/copilot-win32-x64) and runs it against the same ~/.copilot home, registering itself in ~/.copilot/ide/<uuid>.lock. That instance appears to hold the handles for its whole lifetime.

Expected

Plugin install / update should work while an IDE-hosted CLI instance is running — e.g. open plugin directories with FILE_SHARE_DELETE, or release the handles after enumeration.

Impact

Anyone who keeps VS Code open cannot install or update any plugin, and the error message gives no hint about the cause. plugin uninstall hits the same error and can leave a partial state behind (marketplace entry removed, plugin directory still on disk).

Environment

  • Windows 11 Enterprise 10.0.26200
  • GitHub Copilot CLI 1.0.81-7
  • VS Code 1.132.0

贡献指南

打开贡献指南

从这里开始

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

调研方向

从会替换 ~/.copilot/installed-plugins 下目录的插件安装、更新和卸载路径入手,然后检查 IDE 托管的 CLI 如何枚举插件根目录并持有目录句柄。在 VS Code 运行时复现,并验证插件操作能够成功完成,包括卸载操作不会留下部分状态。

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

评估

技术栈
vscode
领域
cli, operating-systems
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
活跃
描述清晰度
基本清楚
新手友好度
50/100

把新 issue 发到你的邮箱

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