Skip to content

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

Description

@rodsnyder

Description

#40764 fixed the @opencode-ai/plugin@local install failure for production desktop builds by defining OPENCODE_VERSION in build-node.ts. But the pin condition in packages/opencode/src/config/config.ts:443 and packages/opencode/src/config/tui.ts:242 still gates on InstallationLocal (InstallationChannel === "local"), not on whether the channel is actually "latest".

For any channel that isn't "local" or "latest" — beta, or a CI/branch build with OPENCODE_CHANNEL set explicitly — packages/script/src/index.ts assigns VERSION a synthetic, never-published string:

IS_PREVIEW = CHANNEL !== "latest"   // line 32
VERSION = `0.0.0-${CHANNEL}-${timestamp}`  // line 36, when IS_PREVIEW

InstallationLocal is false for these builds (channel isn't "local"), so the plugin installer still tries to pin that exact synthetic version:

version: InstallationLocal ? undefined : InstallationVersion

npm install @opencode-ai/plugin@0.0.0-<channel>-<timestamp> 404s — same failure mode as #37806/#30197, just scoped to beta/preview channels instead of every build.

Plugins

n/a — reproduces for any plugin that imports @opencode-ai/plugin, same as the original bug.

OpenCode version

Traced against origin/dev as of 2026-08-12 (after #40764 and #41889 merged).

Steps to reproduce

  1. Build the node/desktop bundle with OPENCODE_CHANNEL=beta and no OPENCODE_VERSION set.
  2. Script.channel returns "beta", Script.version returns 0.0.0-beta-<timestamp>.
  3. Run opencode against any project directory with an SDK-importing plugin.
  4. Background dependency install fires npm install @opencode-ai/plugin@0.0.0-beta-<timestamp> and fails.

Screenshot and/or share link

n/a — build-time logic bug, traced directly in source.

Operating System

n/a (not OS-specific — reproduces on any platform building a non-latest, non-local channel)

Terminal

n/a

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions