Description
Every project directory OpenCode scans triggers a background npm install @opencode-ai/plugin@<version>
(intended to make the plugin SDK available for that project's local .opencode/ agents/commands).
On the packaged Desktop build (v1.18.1, Windows), this always fails with:
NpmInstallFailedError: @opencode-ai/plugin: No matching version found for @opencode-ai/plugin@local
Root cause (traced in app.asar)
InstallationVersion = typeof OPENCODE_VERSION === "string" ? OPENCODE_VERSION : "local";
InstallationChannel = "prod";
InstallationLocal = InstallationChannel === "local"; // always false in this build
...
version: InstallationLocal ? undefined : InstallationVersion
OPENCODE_VERSION is meant to be substituted with a real version string at build time, but isn't in
this build — it falls through to the literal string "local", which isn't a valid npm dist-tag, so the
install 404s every time.
Impact
Cosmetic but noisy: fires as a logWarning, not a thrown error, so it doesn't block config/plugin
loading — but it repeats for every open project directory on every restart (13+ times in one session
across 5 project dirs), and appears to be one of the triggers for the generic
"Session error / An error occurred" toast (notification.session.error.fallbackDescription), since
that's the app's catch-all for any unhandled session-level error.
Workaround attempted (didn't work)
Pre-seeded a package.json in the affected directory with @opencode-ai/plugin pinned to a real,
already-installed version (1.17.3), hoping the installer would see it as already satisfied. It still
failed identically — the install call appears to run unconditionally rather than checking the existing
package.json first.
Fix
Ensure OPENCODE_VERSION is properly injected as the real app version string at build time for the
packaged Desktop release, instead of falling through to the "local" placeholder.
Environment
- OpenCode Desktop 1.18.1, Windows
Description
Every project directory OpenCode scans triggers a background
npm install @opencode-ai/plugin@<version>(intended to make the plugin SDK available for that project's local
.opencode/agents/commands).On the packaged Desktop build (v1.18.1, Windows), this always fails with:
Root cause (traced in app.asar)
OPENCODE_VERSIONis meant to be substituted with a real version string at build time, but isn't inthis build — it falls through to the literal string
"local", which isn't a valid npm dist-tag, so theinstall 404s every time.
Impact
Cosmetic but noisy: fires as a
logWarning, not a thrown error, so it doesn't block config/pluginloading — but it repeats for every open project directory on every restart (13+ times in one session
across 5 project dirs), and appears to be one of the triggers for the generic
"Session error / An error occurred" toast (
notification.session.error.fallbackDescription), sincethat's the app's catch-all for any unhandled session-level error.
Workaround attempted (didn't work)
Pre-seeded a
package.jsonin the affected directory with@opencode-ai/pluginpinned to a real,already-installed version (1.17.3), hoping the installer would see it as already satisfied. It still
failed identically — the install call appears to run unconditionally rather than checking the existing
package.json first.
Fix
Ensure
OPENCODE_VERSIONis properly injected as the real app version string at build time for thepackaged Desktop release, instead of falling through to the "local" placeholder.
Environment