Skip to content

Plugins with implied latest version don't auto-update on restart #6774

Description

@backnotprop

Description

When a plugin is configured without a version (defaulting to "latest"):

 {
"plugin": ["@plannotator/opencode"]
}

It doesn't update to newer versions on subsequent OpenCode starts.

Root Cause

In packages/opencode/src/bun/index.ts, after installing a "latest" plugin, the resolved version is saved to the cache:

 if (version === "latest") {
resolvedVersion = installedPkg.version // e.g. "0.2.3"
}
parsed.dependencies[pkg] = resolvedVersion // Saves "0.2.3", not "latest"

On next startup, the check parsed.dependencies[pkg] === version compares "0.2.3" === "latest" which is false, so it proceeds to reinstall - but Bun's registry cache often returns the same version.

Workaround:

Users can manually clear the cache:

rm -rf ~/.cache/opencode/node_modules/<plugin-name>

Suggested Fix:
#6772

Plugins

plannotator

OpenCode version

latest

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

mac

Terminal

ghostty

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions