Problem
When a plugin is configured with an npm dist-tag specifier (e.g. "oc-solomemory@dev"), BunProc.install() resolves the tag to a concrete version on first install and writes it into bun.lock. On subsequent startups, bun sees the specifier "dev" hasn't changed, trusts the lockfile, and skips re-resolving — even though the dist-tag now points to a newer version on npm.
This means plugins using dist-tags like @dev, @beta, @canary, @next etc. are effectively pinned to whatever version was first installed, and never auto-update.
Steps to Reproduce
- Configure a plugin with a dist-tag:
"plugin": ["my-plugin@dev"]
- Start opencode — plugin installs correctly (e.g.
1.0.7-dev.20260208142630.abc1234)
- Publish a new version to the same dist-tag (e.g.
1.0.7-dev.20260208144503.def5678)
- Restart opencode — plugin stays on the old version
Root Cause
In packages/opencode/src/bun/index.ts (around line 78), BunProc.install() compares the specifier from config against what's in package.json. Since both are "dev", it either skips install entirely or runs bun install which is a no-op due to the lockfile.
Deleting just bun.lock is insufficient — bun also short-circuits when node_modules/<package> already exists. Both bun.lock AND the cached node_modules/<package> directory must be deleted to force re-resolution.
Current Workaround
rm -rf ~/.cache/opencode/node_modules/<plugin-name> ~/.cache/opencode/bun.lock
# Then restart opencode
Suggested Fix
For plugin specifiers that are dist-tags (not semver ranges or exact versions), BunProc.install() should either:
- Pass
--force to bun for dist-tag specifiers, forcing re-resolution on every startup
- Delete the lockfile entry for dist-tag plugins before running
bun install
- Run
bun update <package> instead of bun install when the specifier is a dist-tag
Detection heuristic: if the specifier after @ is not a valid semver range (i.e. doesn't start with a digit, ^, ~, >=, etc.), it's a dist-tag.
Environment
- opencode: latest (upstream
anomalyco/opencode)
- bun: 1.x
- OS: Linux (Ubuntu)
Problem
When a plugin is configured with an npm dist-tag specifier (e.g.
"oc-solomemory@dev"),BunProc.install()resolves the tag to a concrete version on first install and writes it intobun.lock. On subsequent startups, bun sees the specifier"dev"hasn't changed, trusts the lockfile, and skips re-resolving — even though the dist-tag now points to a newer version on npm.This means plugins using dist-tags like
@dev,@beta,@canary,@nextetc. are effectively pinned to whatever version was first installed, and never auto-update.Steps to Reproduce
"plugin": ["my-plugin@dev"]1.0.7-dev.20260208142630.abc1234)1.0.7-dev.20260208144503.def5678)Root Cause
In
packages/opencode/src/bun/index.ts(around line 78),BunProc.install()compares the specifier from config against what's inpackage.json. Since both are"dev", it either skips install entirely or runsbun installwhich is a no-op due to the lockfile.Deleting just
bun.lockis insufficient — bun also short-circuits whennode_modules/<package>already exists. Bothbun.lockAND the cachednode_modules/<package>directory must be deleted to force re-resolution.Current Workaround
Suggested Fix
For plugin specifiers that are dist-tags (not semver ranges or exact versions),
BunProc.install()should either:--forceto bun for dist-tag specifiers, forcing re-resolution on every startupbun installbun update <package>instead ofbun installwhen the specifier is a dist-tagDetection heuristic: if the specifier after
@is not a valid semver range (i.e. doesn't start with a digit,^,~,>=, etc.), it's a dist-tag.Environment
anomalyco/opencode)