Bug: copilot plugin update does not sync new version to config.json
Description
After running copilot plugin update <name>, the plugin files on disk are updated to the latest version (git checkout succeeds), but the version field in ~/.copilot/config.json is not updated -- it still shows the version from the original install.
This was previously reported in #3058, which was closed without comment or fix reference. The bug persists on the latest CLI version.
Environment
- Copilot CLI: 1.0.41-1
- OS: Windows 11
- Shell: PowerShell 7
Steps to Reproduce
- Install a plugin from a GitHub repo:
copilot plugin install owner/repo
- Note the installed version in
~/.copilot/config.json:
{"name": "my-plugin", "version": "1.0.0", "marketplace": "local"}
- A new version is released upstream (e.g.,
v1.1.0 tag pushed to the repo)
- Update the plugin:
copilot plugin update my-plugin
Command reports success.
- Check
~/.copilot/config.json -- version field is still "1.0.0"
Observed Behavior
| Source |
Version |
~/.copilot/config.json installedPlugins[].version |
1.0.0 ❌ (stale -- never updated) |
plugin.json on disk (inside installed plugin dir) |
1.1.0 ✅ |
git describe --tags --exact-match (in plugin install dir) |
v1.1.0 ✅ |
Expected Behavior
After copilot plugin update succeeds, config.json's installedPlugins[].version should reflect the new version. copilot plugin list should report the actual installed version, not the stale install-time version.
Impact
copilot plugin list reports the wrong version
- Any tooling reading
config.json (TUIs, scripts, automation) shows stale versions
- Particularly affects "local" plugins (
marketplace: "local") that have no package.json -- only plugin.json. The version detection fallback is:
package.json -- not present for config-only plugins
config.json version field -- permanently stale after first update
So for an entire class of plugins (git-backed, no package.json), the reported version is wrong after any update.
Suggested Fix
After the git operation completes in the update command, read the new version and write it back:
new_version = read("plugin.json").version ?? read("package.json").version ?? git_describe_tags()
config.installedPlugins[name].version = new_version
write(config_path, config)
Related
Bug:
copilot plugin updatedoes not sync new version toconfig.jsonDescription
After running
copilot plugin update <name>, the plugin files on disk are updated to the latest version (git checkout succeeds), but theversionfield in~/.copilot/config.jsonis not updated -- it still shows the version from the original install.This was previously reported in #3058, which was closed without comment or fix reference. The bug persists on the latest CLI version.
Environment
Steps to Reproduce
~/.copilot/config.json:{"name": "my-plugin", "version": "1.0.0", "marketplace": "local"}v1.1.0tag pushed to the repo)~/.copilot/config.json-- version field is still"1.0.0"Observed Behavior
~/.copilot/config.jsoninstalledPlugins[].versionplugin.jsonon disk (inside installed plugin dir)git describe --tags --exact-match(in plugin install dir)Expected Behavior
After
copilot plugin updatesucceeds,config.json'sinstalledPlugins[].versionshould reflect the new version.copilot plugin listshould report the actual installed version, not the stale install-time version.Impact
copilot plugin listreports the wrong versionconfig.json(TUIs, scripts, automation) shows stale versionsmarketplace: "local") that have nopackage.json-- onlyplugin.json. The version detection fallback is:package.json-- not present for config-only pluginsconfig.jsonversionfield -- permanently stale after first updateSo for an entire class of plugins (git-backed, no
package.json), the reported version is wrong after any update.Suggested Fix
After the git operation completes in the update command, read the new version and write it back:
Related