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

Open
opened 2026-02-16 17:42:45 -05:00 by yindo · 4 comments
Owner

Originally created by @backnotprop on GitHub (Jan 3, 2026).

Originally assigned to: @thdxr on GitHub.

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:
https://github.com/anomalyco/opencode/pull/6772

Plugins

plannotator

OpenCode version

latest

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

mac

Terminal

ghostty

Originally created by @backnotprop on GitHub (Jan 3, 2026). Originally assigned to: @thdxr on GitHub. ### Description When a plugin is configured without a version (defaulting to "latest"): ```json { "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: https://github.com/anomalyco/opencode/pull/6772 ### Plugins plannotator ### OpenCode version latest ### Steps to reproduce _No response_ ### Screenshot and/or share link _No response_ ### Operating System mac ### Terminal ghostty
yindo added the bug label 2026-02-16 17:42:45 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 3, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #6765: Infinite installation loop of @aws-sdk/credential-providers - describes the same root cause ("latest" version comparison issue)
  • #6159: Plugin Auto-Update Feature - broader feature request related to plugin version management

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 3, 2026): This issue might be a duplicate of existing issues. Please check: - #6765: Infinite installation loop of @aws-sdk/credential-providers - describes the same root cause ("latest" version comparison issue) - #6159: Plugin Auto-Update Feature - broader feature request related to plugin version management Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Jan 3, 2026):

do @latest as a workaround for now

@rekram1-node commented on GitHub (Jan 3, 2026): do @latest as a workaround for now
Author
Owner

@backnotprop commented on GitHub (Jan 3, 2026):

@rekram1-node updated my docs for users

@backnotprop commented on GitHub (Jan 3, 2026): @rekram1-node updated my docs for users
Author
Owner

@backnotprop commented on GitHub (Jan 7, 2026):

plugin caching is brutal.

maybe worth taking a look at https://github.com/anomalyco/opencode/pull/6772

@backnotprop commented on GitHub (Jan 7, 2026): plugin caching is brutal. maybe worth taking a look at https://github.com/anomalyco/opencode/pull/6772
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4137