Skip to content

fix(desktop): only pin @opencode-ai/plugin version for production releases - #42003

Open
rodsnyder wants to merge 1 commit into
anomalyco:devfrom
rodsnyder:fix/open-code-version-node-build
Open

fix(desktop): only pin @opencode-ai/plugin version for production releases#42003
rodsnyder wants to merge 1 commit into
anomalyco:devfrom
rodsnyder:fix/open-code-version-node-build

Conversation

@rodsnyder

Copy link
Copy Markdown

Issue for this PR

Closes #42002

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

#40764 fixed the @opencode-ai/plugin@local install failure for production desktop builds, but the plugin-pin condition in config.ts and tui.ts still checks InstallationLocal (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 sets OPENCODE_CHANNEL — gets a synthetic, never-published version from packages/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/plugin published) pin an exact version. Everything else — local dev, beta, branch builds — installs @opencode-ai/plugin@latest instead of a version that doesn't exist on the registry.

How did you verify your code works?

Traced InstallationChannel/InstallationVersion through packages/core/src/installation/version.ts and packages/script/src/index.ts against current origin/dev. Confirmed CHANNEL/VERSION computation: any channel other than "latest" sets IS_PREVIEW = true, and VERSION becomes a timestamped 0.0.0-<channel>-* string that is never published to npm — the pin then always fails for those channels regardless of InstallationLocal. The fix only changes which channel value triggers the pin; both branches (InstallationVersion string vs undefined) match the existing type signature the code already used.

Screenshots / recordings

n/a — non-UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

…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.
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.

Preview/beta channel builds still pin @opencode-ai/plugin to an unpublished synthetic version

1 participant