Skip to content

Bug: copilot plugin update does not sync new version to config.json (still broken on v1.0.41) #3129

@ericchansen

Description

@ericchansen

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

  1. 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.

  2. Note the installed version in ~/.copilot/config.json:
    json {"name": "my-plugin", "version": "1.0.0", "marketplace": "local", "cache_path": "/path/to/my-plugin"}

  3. The plugin repo gets a new tag (e.g., v1.1.0)

  4. Update the plugin:
    copilot plugin update my-plugin
    Command reports success.

  5. 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:
    1. package.json -- not present for config-only plugins
    2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:pluginsPlugin system, marketplace, hooks, skills, extensions, and custom agents

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions