Skip to content

feat(tui): tell users to start OpenCode again after an update restart - #58139

Merged
vimtor merged 4 commits into
devfrom
tui-update-restart-notice
Oct 22, 2026
Merged

vimtor merged 4 commits into
devfrom
tui-update-restart-notice

Conversation

@opencode-agent

@opencode-agent opencode-agent Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

After installing an update from the /update dialog, Restart just quits the TUI, which leaves you at your shell prompt with no hint about what to do next. Now, once an update has been installed locally, every way out of the TUI (dialog Restart, the home "/exit restart to use v…" notice, /exit, Ctrl+C) prints the exit banner with a pointer to the new version:

  <opencode wordmark>

  Run opencode to use 2.0.1

If you quit from inside a session, the existing Session and Continue opencode -s … rows still print below that line.

  • The epilogue context is now { session(value), updatedVersion(version) }. The session route reports its title and ID. The update context reports the version whenever it learns of a local install: a dialog install, a check that finds one already installed, a background auto-install, or a non-remote server installation.updated. app.tsx builds the one banner with epilogue({ session, updatedVersion }), which replaces sessionEpilogue.
  • Exit keeps its original signature.
  • The dialog copy no longer promises an automatic restart and session resume. It now reads "Update successful! Restart closes OpenCode, then run opencode to use the new version." (tui: "Restart" after /update exits to the shell instead of restarting OpenCode #56103)

Tests:

  • bun test test/app-lifecycle.test.tsx test/util/presentation.test.ts test/component/dialog-update.test.tsx test/session-home.test.tsx in packages/tui: 63 pass.
  • New app tests drive /update → Restart, and a background install followed by /exit, then check stdout. The background test fails without the change.
  • tsc -b in packages/tui is clean.

Related: #56103

Requested by: @vimtor (victor via Slack)


Added by the opencode bot (AI-generated).

Related: #56103

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as described: after /update → Restart, the TUI now prints the "Updated … run opencode to start it" line. I checked with the new app test, which fails on the base and passes here, plus the related tests and tsc -b. No real update could be installed in the sandbox.

Public API is unchanged: Exit is internal to the TUI, and every existing caller still works.

Two gaps:

  • The home-screen notice for an update that installed in the background ("/exit restart to use v…", routes/home.tsx:154) still calls a bare exit(). Restarting from there prints nothing, so users get the same silent exit this PR is fixing. See the inline comment.
  • DialogUpdate still says "A restart is required. Any active sessions will be resumed automatically." above a Restart button, while it actually just quits. That mismatch is what #56103 reports. It would be good to update that text here too, so the dialog matches the new notice.

Related: #56103

Comment thread packages/tui/src/context/update-notification.tsx Outdated

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new commit works: the update restart now goes into the exit banner. Outside a session it shows "Updated / Restart opencode". Inside a session it shows "Updated" above the existing Session and Continue rows. With neither, nothing is printed, as before. I checked with the updated app test (/update → Restart, then stdout), the presentation tests, and tsc -b. All pass.

Public API is unchanged: Exit and the epilogue context are internal to the TUI.

The earlier point about the home-screen restart path is still open.

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new commit is fine: after Restart, the banner now says "Run opencode to use ", and the Session/Continue rows still follow it inside a session. Quitting a session without an update prints the same banner as before. I checked with the updated app and presentation tests and tsc -b. All pass.

Public API is unchanged.

The earlier point about the home-screen restart path is still open.

@vimtor
vimtor merged commit 58d5c02 into dev Oct 22, 2026
14 checks passed
@vimtor
vimtor deleted the tui-update-restart-notice branch October 22, 2026 15:23

@opencode-agent opencode-agent Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The earlier point about the home-screen restart path is addressed. The update context now records the installed version whenever it learns of a local install, so the home notice, /exit and Ctrl+C all print the banner, as well as the dialog's Restart. The dialog text no longer promises an automatic restart and session resume.

I checked with the new app tests: /update → Restart, and a background install followed by /exit. Both fail on the base and pass here. All 63 tests in the four files pass, and tsc -b is clean.

Public API is unchanged: Exit is back to its original signature, and the epilogue context is internal to the TUI.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant