Repository navigation
feat(tui): replace V1 auto-update with V2-style /update dialog - #54409
Merged
Merged
Conversation
…release-notes link
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?
OpenCode 1 no longer installs updates on its own. It now uses the same update flow as OpenCode 2: it checks for a new version, shows a notice, and installs only when you run
/update.Before
global.upgradeendpoint.After
upgrade()now only works out whether a newer version exists.autoupdate: falseandOPENCODE_DISABLE_AUTOUPDATEstill turn off checks, andtrueand"notify"now both just notify.updatersource./updateto install v1.x.y. After an install it reads/exitrestart to use v1.x.y. It's placed under the logo and uses the same order, wording and layout as V2./updateopens V2's update dialog ("Update available", "An update is available. After installing, you'll be prompted to restart OpenCode.", with Skip / Update buttons). Progress ("Installing OpenCode 1.x.y…") and errors appear inside the dialog, and when it's done it shows "Update successful! A restart is required." with a Restart button./updateto upgrade to OpenCode 2.0, and the dialog (normal width) says "OpenCode 2.0 is the next major release." then, on its own line, "Read more about it: https://anoma.ly/notes/opencode-2-0" (clickable), then a blank line and "It contains some breaking changes.", with Dismiss / Upgrade. Upgrade runsInstallation.upgradeMajor(theupgrade --majorpath). When a newer 1.x release exists, the flow is the normal OpenCode 1 update and OpenCode 2.0 isn't offered.Installation.method(),Installation.upgrade()andInstallation.upgradeMajor(). They don't go through the server, and the server API and SDK are unchanged apart from the regeneratedautoupdatedescription.skipped_version, and the notice returns only for a newer 1.x release.update_dismissed_until)./updatekeeps working either way.autoupdate, theOPENCODE_DISABLE_AUTOUPDATEdescription,upgrade --major, and a new/updateentry) and the CLI help snapshot for--major.How did you verify your code works?
bun run typecheck(turbo, all packages)packages/tui:bun test(199 pass), including the newtest/component/dialog-update.test.tspackages/opencode:bun test test/cli test/installation test/config, including the newtest/cli/upgrade.test.tsoxlinton the changed files: no errors. Rootbun run linthas one error that already exists onv1.npm_config_registry) and a stubbunthat fakes the global install, so nothing was really installed. I checked both paths (a 1.x update available, and 1.x up to date with OpenCode 2 offered): the notice, the dialog, the in-dialog progress, the restart state and the post-install notice.Screenshots / recordings
I captured screenshots locally of both paths: notice, dialog, install progress and restart prompt (see the session report).
Checklist
— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊