Bug: copilot plugin update does not sync new version to config.json for local plugins
Description
After running copilot plugin update <name> on a locally-installed plugin, 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 local path:
copilot plugin install /path/to/my-plugin
This produces a config.json entry with "marketplace": "local" and a cache_path pointing to the local directory.
-
Note the installed version in ~/.copilot/config.json:
json {"name": "my-plugin", "version": "1.0.0", "marketplace": "local", "cache_path": "/path/to/my-plugin"}
-
The plugin repo gets a new tag (e.g., v1.1.0)
-
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.jsonfor local pluginsDescription
After running
copilot plugin update <name>on a locally-installed plugin, 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
Install a plugin from a local path:
copilot plugin install /path/to/my-pluginThis produces a
config.jsonentry with"marketplace": "local"and acache_pathpointing to the local directory.Note the installed version in
~/.copilot/config.json:json {"name": "my-plugin", "version": "1.0.0", "marketplace": "local", "cache_path": "/path/to/my-plugin"}The plugin repo gets a new tag (e.g.,
v1.1.0)Update the plugin:
copilot plugin update my-pluginCommand reports success.
Check
~/.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:
new_version = read("plugin.json").version ?? read("package.json").version ?? git_describe_tags() config.installedPlugins[name].version = new_version write(config_path, config)Related