Repository navigation
Description
What happened?
A plugin configured as oh-my-openagent@latest stayed pinned to an older npm package version in OpenCode's plugin package cache, even though npm latest had advanced.
This caused OpenCode to keep loading old plugin behavior until I manually removed the cached package directory and pinned the plugin to the current version.
Evidence
My OpenCode config had:
{
"plugin": [
"oh-my-openagent@latest"
]
}But the OpenCode package cache contained:
// C:\Users\Me\.cache\opencode\packages\oh-my-openagent@latest\package.json
{
"dependencies": {
"oh-my-openagent": "3.17.4"
}
}At the same time:
npm view oh-my-openagent version
# 3.17.12So @latest was not re-resolved. The cache directory was valid enough for the plugin to load, but it loaded stale code.
User-visible impact
The stale oh-my-openagent 3.17.4 build had older model routing behavior. It treated Sisyphus + GPT-5.5 as invalid and switched sessions to Hephaestus, even though oh-my-openagent 3.17.12 includes GPT-5.5-native Sisyphus support.
Expected behavior
For plugin specs using a moving tag/range such as package@latest, OpenCode should periodically re-resolve the package, validate whether the cached dependency satisfies the requested spec, or otherwise avoid treating the wrapper cache directory as permanently fresh.
At minimum, a cache hit for oh-my-openagent@latest should not continue to use oh-my-openagent 3.17.4 after npm latest is 3.17.12.
Actual behavior
OpenCode reused:
C:\Users\Me\.cache\opencode\packages\oh-my-openagent@latest
The wrapper package.json inside that cache still depended on oh-my-openagent 3.17.4.
Workaround
This fixed the issue locally:
Remove-Item -LiteralPath 'C:\Users\Me\.cache\opencode\packages\oh-my-openagent@latest' -Recurse -ForceThen I pinned the plugin explicitly:
{
"plugin": [
"[email protected]"
]
}I also preinstalled the pinned cache path:
npm install --prefix C:\Users\Me\.cache\opencode\packages\oh-my-openagent@3.17.12 oh-my-openagent@3.17.12Related issue
This seems related to plugin package cache behavior discussed in #23502, but this report is specifically about a successful/usable cache hit for @latest staying pinned to a stale dependency version rather than an ENOENT or incomplete install.
Environment
- OS: Microsoft Windows NT 10.0.26200.0
- OpenCode: 1.14.31
- Node: v22.20.0
- npm: 10.9.3
- Plugin spec:
oh-my-openagent@latest - Cached dependency observed:
oh-my-openagent 3.17.4 - npm latest observed:
oh-my-openagent 3.17.12
Activity
github-actions commentedon May 1, 2026
This issue might be a duplicate of existing issues. Please check:
@latestgets pinned to a specific version in the cache and does not re-resolve on subsequent startups. The workaround (clearing the cache directory) is also the same.opencode plugin updatecommand #18544: Related feature request for a manualopencode plugin updatecommand to address this class of problem.If your issue is specifically about the cache fast-path not re-checking npm for a newer version (rather than an ENOENT or broken path), it may still be worth keeping open as a distinct sub-case, but please review those issues and comment there if they cover your scenario.
pokk commentedon May 19, 2026
Additional repro (macOS, OpenCode 1.15.5)
Same bug, different OS, and a second plugin — confirming this isn't
oh-my-openagent-specific.Plugin 1:
oh-my-openagent@latest4.1.24.2.2~/.cache/opencode/packages/oh-my-openagent@latest/node_modules/oh-my-openagent/Plugin 2:
@ex-machina/opencode-anthropic-auth@latest1.8.01.8.1~/.cache/opencode/packages/@ex-machina/opencode-anthropic-auth@latest/node_modules/@ex-machina/opencode-anthropic-auth/Both directories were created on 2026-05-15 (first opencode launch with these plugins). Neither was ever re-resolved on subsequent session starts.
Workaround (POSIX flavor of the original report)
Next opencode start re-downloads to current npm latest.
Environment
1.14.x → 1.15.xrangeopencode.json(cmux-managed):oh-my-openagent@latest@ex-machina/opencode-anthropic-auth@latestSide note
Any floating-tag spec (
@latest,@beta,@next, etc.) hits this surface because the per-plugin cache directory is keyed by the literal version-spec string. The flat shared-deps tree at~/.cache/opencode/packages/node_modules/does refresh on its own schedule, but it isn't the path opencode resolves plugin entrypoints from (that's the per-plugin isolated<spec>/node_modules/<pkg>/tree).@latestspecifier gets permanently pinned to stale version #30631 as a duplicate of this issueagopalareddy commentedon Jun 3, 2026
Additional reproduction + root cause confirmation (OpenCode 1.15.13, Linux, Bun)
Can confirm this is still happening on the latest release. Tracked down the exact code path.
Concrete impact case:
@tarquinen/opencode-dcpDCP
3.1.8had a bug where themessages.transformhook created a shadowed local array copy (messages.filter(...)returns a new array), so structural mutations from theprune()function (messages.length = 0; messages.push(...)) never propagated back tooutput.messages. Net result: the compress tool fired, summaries were generated, but the LLM never saw the compressed context — it kept receiving the full uncompressed messages. Context grew monotonically, compression was a no-op.The fix shipped in
3.1.12. But on my system,@latestwas permanently pinned to3.1.8(installed back in April).Root cause chain
In
packages/opencode/src/plugin/shared.ts:Npm.add()operates likenpm install— it writes apackage.jsonwith the resolved version at install time and never re-evaluates on subsequent starts. The wrapper directory atpackages/<plugin>@latest/is treated as "valid" and itsnode_modulesare satisfied, so the loader returns it without ever hitting npm again.Stale caches observed
Suggested approach
The simplest path matches the suggestion already here — on startup, if a plugin spec contains
@latest(or any floating range), compare the installed wrapper version against npm and either auto-update or warn. Even just logging a warning when the installed version is behind npmlatestwould surface this to users who have no idea they're stuck on stale code.holgerreppert commentedon Jun 8, 2026
Same here. Would be nice to have my plugin updated.....
dio16 commentedon Jun 13, 2026
I was about to file a duplicate, but this issue already covers the root behavior. Adding a Linux +
oh-my-opencode-slim@latestrepro because it reproduced the same stale@latestcache path afteropencode plugin -g -f.Repro
Published latest observed:
pnpm view oh-my-opencode-slim version # 2.0.0Cached plugin version observed before workaround:
Force-updating global plugin config:
This updated the OpenCode plugin config, but the cached plugin still reported
1.1.2. The UI kept loading the old version until the cache directory was removed.Workaround
After removing the cache directory,
@latestresolved to2.0.0.Suggested fix direction
The cache key appears to be the literal spec string, so
oh-my-opencode-slim@latestreuses the same cache entry even when npmlatestchanges. A robust fix would resolve floating specs before cache lookup and include the resolved version in the cache key, or force-delete/refresh the existing cache directory when-fis used with a floating spec.Example direction:
Template fields
1.17.4xterm-256colordocs: pin plugin version on install/dogfood — OpenCode never re-resol…
github-actions commentedon Aug 13, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.