fix(opencode): define OPENCODE_VERSION in the node server build#36528
Open
H3XDaemon wants to merge 1 commit into
Open
fix(opencode): define OPENCODE_VERSION in the node server build#36528H3XDaemon wants to merge 1 commit into
H3XDaemon wants to merge 1 commit into
Conversation
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 #30197
Type of change
What does this PR do?
The node server bundle that the desktop app ships as its sidecar is built by
script/build-node.ts, which definesOPENCODE_CHANNELbut notOPENCODE_VERSION(the CLI build inscript/build.tsdefines both). At runtime that global doesn't exist, soInstallationVersionfalls back to"local"whileInstallationLocalstays false — and config startup pins the plugin dependency install to@opencode-ai/plugin@local, a version that doesn't exist on npm. Every desktop install hits this on every session; #30908 and likely #31708 are the same failure.It also means anything reading
InstallationVersionin the sidecar reportslocal— session records, telemetry serviceVersion, User-Agent.One line: add the same
OPENCODE_VERSIONdefine the CLI build already uses.How did you verify your code works?
Built the bundle before and after with
OPENCODE_VERSION=1.17.18 OPENCODE_CHANNEL=latest. Before: the bundle still contains thetypeof OPENCODE_VERSION === "string" ? OPENCODE_VERSION : "local"fallback (channel is inlined, version is not). After:InstallationVersion = "1.17.18"is inlined and the fallback is gone, so the dependency install resolves@opencode-ai/plugin@1.17.18, which exists on the registry. The@localspec in the reported logs matches this exact path — I hit it on my own machine (see #35986 debugging) where the failed install caused the plugin to resolve to workspace TS sources under node.Screenshots / recordings
n/a
Checklist