Skip to content

feat(tui): replace V1 auto-update with V2-style /update dialog - #54409

Merged
thdxr merged 5 commits into
v1from
v1-manual-update
Oct 11, 2026
Merged

thdxr merged 5 commits into
v1from
v1-manual-update

Conversation

@thdxr

@thdxr thdxr commented Oct 11, 2026 •

Copy link
Copy Markdown
Member

Issue for this PR

Closes #

Type of change

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

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

  • On startup, patch releases were installed silently. Minor and major releases opened a blocking "Update Available" confirm dialog, and accepting it installed through the server's global.upgrade endpoint.
  • The check ran once per launch.

After

  • Nothing is installed automatically. upgrade() now only works out whether a newer version exists. autoupdate: false and OPENCODE_DISABLE_AUTOUPDATE still turn off checks, and true and "notify" now both just notify.
  • Like the V2 CLI, the TUI process checks every 10 minutes and replays the latest result to the TUI through an updater source.
  • The home screen shows V2's notice: /update to install v1.x.y. After an install it reads /exit restart to use v1.x.y. It's placed under the logo and uses the same order, wording and layout as V2.
  • /update opens 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.
  • OpenCode 2.0 is offered only when OpenCode 1 is already up to date. In that case the notice reads /update to 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 runs Installation.upgradeMajor (the upgrade --major path). When a newer 1.x release exists, the flow is the normal OpenCode 1 update and OpenCode 2.0 isn't offered.
  • As in V2, installs run locally in the CLI/TUI process using the existing Installation.method(), Installation.upgrade() and Installation.upgradeMajor(). They don't go through the server, and the server API and SDK are unchanged apart from the regenerated autoupdate description.
  • Skip (OpenCode 1 updates) keeps V2's behaviour: it stores skipped_version, and the notice returns only for a newer 1.x release.
  • Dismiss (OpenCode 2.0 offer) hides that notice for one week (update_dismissed_until).
  • The two are independent: skipping a 1.x version never hides the 2.0 offer, and dismissing 2.0 never skips a 1.x version. /update keeps working either way.
  • I updated the docs (config autoupdate, the OPENCODE_DISABLE_AUTOUPDATE description, upgrade --major, and a new /update entry) 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 new test/component/dialog-update.test.ts
  • packages/opencode: bun test test/cli test/installation test/config, including the new test/cli/upgrade.test.ts
  • oxlint on the changed files: no errors. Root bun run lint has one error that already exists on v1.
  • I drove the real V1 TUI in tmux with a stubbed registry (npm_config_registry) and a stub bun that 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

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

— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

@thdxr
thdxr merged commit 9c97b80 into v1 Oct 11, 2026
8 checks passed
@thdxr
thdxr deleted the v1-manual-update branch October 11, 2026 00:53
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.

1 participant