Skip to content

fix: resolve 'latest' to actual version when caching plugins#5292

Merged
rekram1-node merged 1 commit intoanomalyco:devfrom
nick-vi:fix/plugin-latest-version-caching
Dec 9, 2025
Merged

fix: resolve 'latest' to actual version when caching plugins#5292
rekram1-node merged 1 commit intoanomalyco:devfrom
nick-vi:fix/plugin-latest-version-caching

Conversation

@nick-vi
Copy link
Contributor

@nick-vi nick-vi commented Dec 9, 2025

Problem

When a plugin is specified without a version (e.g., "my-plugin" or "my-plugin@latest"), OpenCode stores the literal string "latest" in the cache (~/.cache/opencode/package.json).

On subsequent starts, the check parsed.dependencies[pkg] === version compares "latest" === "latest", returns the cached module, and never checks npm for updates.

Fix

After installing a package with @latest, read the actual installed version from the package's package.json and store that instead.

This means:

  • @latest now re-fetches on each start (correct behavior - user wants latest)
  • Explicit versions like @1.2.3 still use cache efficiently

Testing

  1. Clear cache: rm ~/.cache/opencode/package.json
  2. Start OpenCode with a plugin using @latest
  3. Check cache - now shows actual version (e.g., "1.2.3") instead of "latest"

@rekram1-node
Copy link
Collaborator

/review

@rekram1-node
Copy link
Collaborator

Ignore suggestion, I think this let is valid

@rekram1-node rekram1-node merged commit c33a903 into anomalyco:dev Dec 9, 2025
1 of 4 checks passed
shuv1337 added a commit to Latitudes-Dev/shuvcode that referenced this pull request Dec 10, 2025
* chore: format code

* wip(desktop): progress

* chore: regen sdk

* chore: format code

* add project.name/icon

* wip(desktop): progress

* feat: add color to project

* chore: regen sdk

* chore: format code

* rename bus

* rework project loading

* fix ci

* chore: regen sdk

* chore: format code

* core: add automatic project icon discovery from favicon/logo files

* chore: regen sdk

* chore: format code

* core: fix project icon update to preserve existing icon properties

* chore: regen sdk

* chore: format code

* ci: fix sdk gen

* chore: regen sdk

* chore: format code

* core: make project updated timestamp optional to support legacy project data

* core: fix project creation to include updated timestamp

* chore: regen sdk

* chore: format code

* fix: read when file is svg

* chore: regen sdk

* chore: format code

* test fixes

* core: fix project event emission to include updated worktree data

* chore: regen sdk

* chore: format code

* sync

* chore: regen sdk

* chore: format code

* discover logic

* chore: regen sdk

* chore: format code

* fix tests

* fix types

* chore: regen sdk

* chore: format code

* format on write

* fix: resolve 'latest' to actual version when caching plugins (anomalyco#5292)

* ci: fix sdk workflow

* wip(desktop): progress

* wip(desktop): progress

* wip(desktop): progress

* wip(desktop): progress

* wip(desktop): progress

* feat: add Biome LSP support (anomalyco#5290)

* wip(desktop): progress

* wip(desktop): progress

* add OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT

* wip(desktop): progress

* wip(desktop): progress

* wip(desktop): progress

* core: fix project icon update handling to preserve existing icon properties

* wip(desktop): progress

* wip(desktop): progress

* better interleaved thinking support (anomalyco#5298)

* fix: add spacer before queued badge

* tweak: add OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS

* ignore: rm chalk

* Update Nix flake.lock and hashes

* ci fix

* chore: regen sdk

* chore: format code

* ci

* chore: regen sdk

* ci: combine sdk and format workflows into single generate workflow

* ci

* ci

* ci

* ci

* ci

* ci

* ci

* ci

* ci

* fix: re-enable tauri typecheck

* ci

* ci

* ci

* ci

* ci

* ci

* ci

* ci

* ci

* ci

* ci

* ci

* sync

* ci

* ci

* ci

* ci

* docs: Add portal project to ecosystem documentation (anomalyco#5300)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* core: enable project discovery for experimental builds

* ci: publish with multiple tags instead of using dist-tag

npm dist-tag add command is broken, so publish package multiple times
with different tags directly instead

* ci

* ci

* ci

* release: v1.0.141

* sync: record last synced tag v1.0.141

* chore: format code

---------

Co-authored-by: GitHub Action <action@github.com>
Co-authored-by: Adam <2363879+adamdotdevin@users.noreply.github.com>
Co-authored-by: Dax Raad <d@ironbay.co>
Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
Co-authored-by: Nick <105120312+nick-vi@users.noreply.github.com>
Co-authored-by: ry2009 <134240944+ry2009@users.noreply.github.com>
Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
Co-authored-by: David Hill <iamdavidhill@gmail.com>
Co-authored-by: Hosenur Rahaman <hosenur.dev@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: opencode <opencode@sst.dev>
Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants