Repository navigation
fix(opencode): keep OpenCode 1 updates on 1.x using npm discovery - #54904
Merged
Merged
Conversation
4 of 6 tasks
thdxr
force-pushed
the
v1-update-isolation
branch
from
October 16, 2026 01:17
9e84409 to
13cdadf
Compare
lacymorrow
added a commit
to lacymorrow/lash
that referenced
this pull request
Oct 19, 2026
Upstream added script/install.test.ts in anomalyco#54904 to cover its OpenCode 1 vs 2 release gating. Merged as-is it asserts behavior lash deliberately does not have: anomalyco/opencode URLs, $HOME/.opencode/bin, and a refusal of 2.x versions. Retargeted at lash's installer and added a guard for the regression this week's merge introduced, where the non-conflicting half of upstream's release-discovery rewrite put a hard-coded anomalyco/opencode download URL back into the installer. The stub curl now refuses every host but lacymorrow/lash. Also builds a zip on darwin instead of skipping, so the download and extract path is exercised outside linux CI. 7/7 pass.
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 #
Type of change
What does this PR do?
This keeps OpenCode 1 clients on 1.x once OpenCode 2 is published as GitHub Releases.
This PR no longer uses the update service. Every install method gets its version from the
opencode-ainpm package, which only ever contains OpenCode 1; OpenCode 2 ships as@opencode/cli. Nothing in OpenCode 1 reads GitHub'sreleases/latestany more. #54903 is now only needed to publish 2.0 GitHub Releases. Itsv1update-service channel and the seeding step indocs/release/v1-v2-isolation.mddon't apply to OpenCode 1.Version discovery (
Installation.latest()):${registry}/opencode-ai/latestusing the user's npm registry (registry.npmjs.org by default). Preview builds use their own dist-tag. The lookup times out after 10s./updatenow shows "Couldn't check for updates." andopencode upgradereports the same instead of crashing.Installing a 1.x update, per method:
opencode-ai@<version>. Yarn upgrades previously failed with "Unknown installation method"; they now work.opencode.ai/installwithVERSION=<version>.opencodeformula is already 2.x, sobrew upgrade opencodewould install OpenCode 2.upgraderefuses and points to--majoror to reinstalling from the tap.anomalyco/tap/opencode): this formula is only written by the OpenCode 1 publish; OpenCode 2 usesopencode-v2andopencode-beta. The tap is updated a few minutes after npm.brew upgrade, it pulls the tap and checks the formula version.choco upgrade --versioncan only install versions the moderated community feed has published. The npm version is only advertised once the feed lists that exact version.scoop install opencode@<version>generates the manifest from the bucket's autoupdate URLs, which point at our GitHub release files. Any published 1.x release can be installed.upgraderefuses 2.x targets and points toopencode upgrade --major.installscript:registry.npmjs.org/opencode-ai/latest(grep/sed, no jq), and checks the release file for this platform exists.v1.*in GitHub's release list. It never usesreleases/latest.releases/download/v$version/.VERSION/--version2.x or later.Release tooling:
script/update-artifact.tsand the publish-to-service step.--lateston the V1 GitHub release and thev1.*filter inraw-changelog.ts.The OpenCode 2.0 offer UI and the semver-aware comparisons in
cli/upgrade.ts/dialog-update.tsxare unchanged from the first revision.Note: merging changes
opencode.ai/installimmediately, because it redirects to theinstallfile onv1. Clients only pick up the CLI changes in the next V1 release.How did you verify your code works?
bun run typecheck(30/30).packages/opencode:bun test test/installation test/cli test/server(708 pass).packages/tui:bun test test/component(12 pass).bun test ./script/install.test.ts ./script/raw-changelog.test.ts(10 pass).opencode-ai@<v>for npm, pnpm, bun and yarn;curland cover:v1.*list when npm fails or the release is still publishing;VERSION2.x refused;Screenshots / recordings
N/A
Checklist
— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊