Skip to content

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

@ErcinDedeoglu

Description

@ErcinDedeoglu

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions