Problem
Once a plugin is installed, there's no way to update it to a newer version without manually clearing the cache.
Current behavior
- User adds
oc-sync (or oc-sync@latest) to their config
- OpenCode installs latest version (e.g., 0.1.4), caches resolved version in
~/.cache/opencode/package.json
- Plugin author publishes 0.1.5 with bug fixes
- User restarts OpenCode - still uses cached 0.1.4
- User has no way to know an update is available or how to get it
Root cause
In packages/opencode/src/bun/index.ts:
if (dependencies[pkg] === version && modExists) return mod
Once installed, the cached version is used forever.
Suggested solutions
Option A: Add opencode update command
opencode update plugins # Update all plugins to latest
opencode update oc-sync # Update specific plugin
Option B: Periodic version check
- On startup, check npm registry for newer versions
- Show notification: "Plugin updates available: oc-sync (0.1.4 → 0.1.5)"
Option C: TTL-based cache invalidation
- Re-check
@latest versions after X days (e.g., 7 days)
Workaround
Currently users must manually:
rm -rf ~/.cache/opencode/node_modules/oc-sync
# or
rm ~/.cache/opencode/package.json
This is not discoverable and plugin authors have no way to notify users of updates.
Problem
Once a plugin is installed, there's no way to update it to a newer version without manually clearing the cache.
Current behavior
oc-sync(oroc-sync@latest) to their config~/.cache/opencode/package.jsonRoot cause
In
packages/opencode/src/bun/index.ts:Once installed, the cached version is used forever.
Suggested solutions
Option A: Add
opencode updatecommandOption B: Periodic version check
Option C: TTL-based cache invalidation
@latestversions after X days (e.g., 7 days)Workaround
Currently users must manually:
This is not discoverable and plugin authors have no way to notify users of updates.