Plugin updates: No way to get latest version after initial install #7543

Open
opened 2026-02-16 18:07:30 -05:00 by yindo · 3 comments
Owner

Originally created by @ErcinDedeoglu on GitHub (Jan 25, 2026).

Originally assigned to: @thdxr on GitHub.

Problem

Once a plugin is installed, there's no way to update it to a newer version without manually clearing the cache.

Current behavior

  1. User adds oc-sync (or oc-sync@latest) to their config
  2. OpenCode installs latest version (e.g., 0.1.4), caches resolved version in ~/.cache/opencode/package.json
  3. Plugin author publishes 0.1.5 with bug fixes
  4. User restarts OpenCode - still uses cached 0.1.4
  5. 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.

Originally created by @ErcinDedeoglu on GitHub (Jan 25, 2026). Originally assigned to: @thdxr on GitHub. ## Problem Once a plugin is installed, there's no way to update it to a newer version without manually clearing the cache. ### Current behavior 1. User adds `oc-sync` (or `oc-sync@latest`) to their config 2. OpenCode installs latest version (e.g., 0.1.4), caches resolved version in `~/.cache/opencode/package.json` 3. Plugin author publishes 0.1.5 with bug fixes 4. User restarts OpenCode - still uses cached 0.1.4 5. User has no way to know an update is available or how to get it ### Root cause In `packages/opencode/src/bun/index.ts`: ```typescript if (dependencies[pkg] === version && modExists) return mod ``` Once installed, the cached version is used forever. ### Suggested solutions **Option A: Add `opencode update` command** ```bash 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: ```bash 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.
Author
Owner

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

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

  • #6159: Plugin Auto-Update Feature - Comprehensive feature request covering auto-update policies and configuration
  • #6774: Plugins with implied latest version don't auto-update on restart - Specifically addresses the 'latest' version not updating issue
  • #10355: opencode.json plugins version overwritten on startup - Related to plugin version management and caching
  • #10441: opencode upgrade doesn't update plugin dependencies in ~/.config/opencode/package.json - Related to plugin update mechanisms

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

@github-actions[bot] commented on GitHub (Jan 25, 2026): This issue might be a duplicate of existing issues. Please check: - #6159: Plugin Auto-Update Feature - Comprehensive feature request covering auto-update policies and configuration - #6774: Plugins with implied latest version don't auto-update on restart - Specifically addresses the 'latest' version not updating issue - #10355: opencode.json plugins version overwritten on startup - Related to plugin version management and caching - #10441: `opencode upgrade` doesn't update plugin dependencies in ~/.config/opencode/package.json - Related to plugin update mechanisms Feel free to ignore if none of these address your specific case.
Author
Owner

@Tarquinen commented on GitHub (Jan 25, 2026):

"plugin": ["opencode-plugin-here@latest"]
authors can also notify users of updates with toasts by comparing npm version to cache version if needed

@Tarquinen commented on GitHub (Jan 25, 2026): `"plugin": ["opencode-plugin-here@latest"]` authors can also notify users of updates with toasts by comparing npm version to cache version if needed
Author
Owner

@athal7 commented on GitHub (Feb 5, 2026):

This also affects explicitly versioned plugins. If I have myplugin@0.20.1 cached and update my config to myplugin@0.20.2, OpenCode still uses the cached 0.20.1 until I manually rm -rf ~/.cache/opencode/node_modules/myplugin.

Expected: OpenCode should compare the requested version against the cached version and reinstall if they differ.

@athal7 commented on GitHub (Feb 5, 2026): This also affects explicitly versioned plugins. If I have `myplugin@0.20.1` cached and update my config to `myplugin@0.20.2`, OpenCode still uses the cached 0.20.1 until I manually `rm -rf ~/.cache/opencode/node_modules/myplugin`. Expected: OpenCode should compare the requested version against the cached version and reinstall if they differ.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7543