github / github/copilot-cli

autoUpdate: false in settings.json is ignored — CLI re-execs a cached prerelease build over the stable version installed via npm

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

还没有人认领这个 Issue。

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

描述

Summary

Once a prerelease build has been cached under ~/.copilot/pkg/<platform>/, the
CLI keeps re-execing it on every launch, even when:

  • a stable version is installed via npm, and
  • "autoUpdate": false is set in ~/.copilot/settings.json.

The documented setting has no effect, because the re-exec into the newer cached
build happens before settings are read. Only the COPILOT_AUTO_UPDATE=false
environment variable changes the behaviour.

The practical result: a user who tries the prerelease channel once cannot get
back to stable through any documented mechanism, and cannot tell they are still
on a prerelease unless they check --version.

Environment

  • Cached prerelease build: 1.0.81-5
  • Stable installed via npm: 1.0.80
  • Node.js v22.21.1, Linux x64

Steps to reproduce

  1. Be on a prerelease build (so it is cached under ~/.copilot/pkg/<platform>/).
  2. npm install -g @github/copilot — installs the current stable release.
    Confirm node_modules/@github/copilot-<platform>/package.json reports the
    stable version.
  3. Set "autoUpdate": false in ~/.copilot/settings.json.
  4. Run copilot --version.

Expected: the stable version, since that is what is installed and
auto-update is disabled.

Actual: the cached prerelease version.

$ copilot --version
GitHub Copilot CLI 1.0.81-5.

The env var behaves differently from the setting

Running the npm-installed platform binary directly:

$ ./copilot --version
GitHub Copilot CLI 1.0.81-5.            # re-execs the cached prerelease

$ COPILOT_AUTO_UPDATE=false ./copilot --version
Package extraction took 7995ms
GitHub Copilot CLI 1.0.80.              # runs the installed stable build

Same binary, same settings file, opposite results — so autoUpdate in
settings.json and COPILOT_AUTO_UPDATE are not equivalent, though
copilot update --help presents them as alternatives:

Use --no-auto-update or set COPILOT_AUTO_UPDATE=false to disable it manually.

and copilot help config documents:

autoUpdate: whether to automatically download updated CLI versions; defaults to true.

There is no documented way back to stable

copilot update stable refuses, because it only compares version ordering and
will not move backwards:

$ copilot update stable
Checking for updates...
Checking GitHub for the latest release...
No update needed, current version is 1.0.81-5, fetched latest release is v1.0.80

Since prerelease versions sort above the current stable release, anyone on
a prerelease is pinned there until a higher stable ships. Combined with the
ignored autoUpdate setting, the only working escape routes are undocumented:
set COPILOT_AUTO_UPDATE=false, or manually delete the cached build
directories.

Also, COPILOT_PKG_CACHE_HOME pointed at an empty directory did not change
resolution — the cached prerelease was still selected.

Suggested fixes

  1. Make "autoUpdate": false in settings.json honoured by the re-exec path,
    or document that it does not cover it.
  2. Give copilot update <channel> a way to switch channels downward
    (e.g. --allow-downgrade, or treat an explicit channel argument as
    authoritative over version ordering).
  3. Surface the channel in --version output, so it is obvious when a
    prerelease is being used.

Found while trying to move off the prerelease channel after hitting #4533 (a
separate defect). This report is only about being unable to leave the
prerelease channel.

贡献指南

打开贡献指南

从这里开始

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

调研方向

首先跟踪 CLI 启动以及在读取 settings.json 之前选择 ~/.copilot/pkg// 的重新执行路径,然后检查 copilot update 的处理和版本比较。使用缓存的 prerelease、稳定版 npm 包以及 autoUpdate false 进行复现;当文档化的配置能够防止意外重新执行,或显式切换频道能够正常工作时,即可完成。

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

评估

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

把新 issue 发到你的邮箱

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