Skip to content

Bug: plugin update does not sync new version to config.json #3058

@ericchansen

Description

@ericchansen

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 (via git pull), but the version field in ~/.copilot/config.json is not updated — it still shows the version from the original install. This causes copilot plugin list to report a stale version.

Steps to Reproduce

  1. Install a plugin that has a plugin.json with a version field:
    copilot plugin install owner/repo
    
  2. Note the installed version:
    copilot plugin list
    # Shows: plugin-name@source (v1.0.0)
    
  3. Wait for the plugin to release a new version (e.g., v2.0.0)
  4. Update the plugin:
    copilot plugin update plugin-name
    # Reports success
    
  5. Check the reported version:
    copilot plugin list
    # Still shows: plugin-name@source (v1.0.0)  <-- WRONG
    
  6. Check the actual installed version on disk:
    cat ~/.copilot/installed-plugins/plugin-name/plugin-name/plugin.json | grep version
    # Shows: "version": "2.0.0"  <-- CORRECT
    

Observed Behavior

Source Version
~/.copilot/config.json installedPlugins[].version 1.0.0 (stale — never updated after install)
~/.copilot/installed-plugins/<name>/<name>/plugin.json 2.0.0 (correct — updated by git pull)
~/.copilot/installed-plugins/<name>/<name>/package.json 2.0.0 (correct)
git describe --tags --exact-match in installed clone v2.0.0 (correct)
copilot plugin list v1.0.0 (wrong — reads config.json)

Expected Behavior

After copilot plugin update, the version field in config.json should be updated to match the new version on disk. copilot plugin list should report the correct current version.

Real-World Example

Tested with msx-mcp plugin:

  • Installed at v0.12.1 — config.json records "version": "0.12.1"
  • Updated to v0.14.1 — all files on disk at 0.14.1, git HEAD at tag v0.14.1
  • copilot plugin list still shows v0.12.1
  • config.json still has "version": "0.12.1"

Suggested Fix

After the git pull/checkout operation in the update command completes, read the new version from the installed plugin.json (or package.json) and write it back to ~/.copilot/config.json.

Environment

  • Copilot CLI: 1.0.40
  • OS: Windows 11
  • Shell: PowerShell 7

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions