fix(desktop): only pin @opencode-ai/plugin version for production releases - #42003
Open
rodsnyder wants to merge 1 commit into
Open
fix(desktop): only pin @opencode-ai/plugin version for production releases#42003rodsnyder wants to merge 1 commit into
rodsnyder wants to merge 1 commit into
Conversation
…eases Non-production builds (dev branches, local source) now install the latest published @opencode-ai/plugin from npm instead of trying a preview version that doesn't exist. Only production releases (InstallationChannel === 'latest') pin the exact InstallationVersion.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #42002
Type of change
What does this PR do?
#40764 fixed the
@opencode-ai/plugin@localinstall failure for production desktop builds, but the plugin-pin condition inconfig.tsandtui.tsstill checksInstallationLocal(channel === "local") instead of whether the channel is actually a production release. Any non-latest, non-local channel — beta, or a CI/branch build that setsOPENCODE_CHANNEL— gets a synthetic, never-published version frompackages/script/src/index.ts(0.0.0-<channel>-<timestamp>), and the installer still tries to pin that exact string.npm install @opencode-ai/plugin@0.0.0-beta-<timestamp>404s, same failure mode as the original bug, just scoped to preview channels.This changes the condition to
InstallationChannel === "latest": only official production releases (guaranteed to have a matching@opencode-ai/pluginpublished) pin an exact version. Everything else — local dev, beta, branch builds — installs@opencode-ai/plugin@latestinstead of a version that doesn't exist on the registry.How did you verify your code works?
Traced
InstallationChannel/InstallationVersionthroughpackages/core/src/installation/version.tsandpackages/script/src/index.tsagainst currentorigin/dev. ConfirmedCHANNEL/VERSIONcomputation: any channel other than"latest"setsIS_PREVIEW = true, andVERSIONbecomes a timestamped0.0.0-<channel>-*string that is never published to npm — the pin then always fails for those channels regardless ofInstallationLocal. The fix only changes which channel value triggers the pin; both branches (InstallationVersionstring vsundefined) match the existing type signature the code already used.Screenshots / recordings
n/a — non-UI change.
Checklist