Skip to content

feat(updater): add opt-in install updates on quit setting (opencode#66501) - #1297

Merged
Hona merged 1 commit into
devfrom
upstream-f/install-updates-on-quit
Nov 26, 2026
Merged

Hona merged 1 commit into
devfrom
upstream-f/install-updates-on-quit

Conversation

@Hona

@Hona Hona commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Ports official anomalyco/opencode#66501 (63261c1c5d617002461a06178fdb5b98c26c15b7, UP-244): adds an opt-in Install updates on quit toggle in Settings -> General -> Updates (off by default on all desktop platforms) and wires it into the native updater's quit handoff on macOS and Windows.

Summary

  • Opt-in preference in features/updater (lib.rs, mac.rs, windows.rs, service.rs):
    • Added set_install_on_quit(bool) / install_on_quit_enabled() defaulting to false.
    • mac.rs: installs_on_quit() now honors install_on_quit_enabled() instead of unconditionally installing on quit. Because Rune swaps the signed bundle directly at quit (no Squirrel.Mac), turning the setting off mid-session disarms quit-install cleanly.
    • windows.rs: implemented installs_on_quit() (self.owned && install_on_quit_enabled()) and install_on_quit() invoking hand_off(false) (--apply-update without --relaunch).
  • Desktop sync and fallback (apps/desktop/src/surfaces/updater.rs, apps/desktop/src/dialogs/settings/updater_fallback.rs):
    • Synced plugin.updater / installOnQuit ({"enabled": bool}, default false) into opencode_feature_updater::set_install_on_quit on store-version change in updater.poll and right before updater.closing.
    • Added the matching settings-install-on-quit row (desktop only, omitted on wasm32) to the single-frame native fallback section between settings-release-notes and settings-check-updates, disabled and unchecked while the updater is starting or disabled.
  • Updater plugin UI and search (plugins/updater/{init,view}.luau, plugin.toml, locales/en.json):
    • Added installOnQuit store (default { enabled = false }), settings-install-on-quit search entry, and desktop-only Settings row between Release notes and Check for updates (matching packages/gui-plugins/src/updater/{contract,main,platform,renderer,section}.tsx, i18n/en.ts).
    • Switch is disabled and shown unchecked when Updater:State() is unavailable or phase == "disabled".

Verification

  • CI run 45763694986 on head bf0a8efd5e: green (guardrails, build-macos, build-windows (x64), build-windows (arm64), build-linux (x64); Linux arm64 skipped).
  • Headless verification on the Windows x64 PR build beside a before build (c1360881ed), 3/3 headless cases passed:
    1. Row and position: setting-settings-install-on-quit renders at y=2570, strictly between setting-settings-release-notes (y=2492) and setting-settings-check-updates (y=2648), with title "Install updates on quit" and description "Automatically install downloaded updates when you quit OpenCode". Before: absent (settings-check-updates directly at y=2570).
    2. Disabled and unchecked in isolated/unsigned build: install-on-quit-switch (role=switch) has focusable=false, muted track #5c5c5cff, thumb at left x=1098 (unchecked; compared with enabled checked release-notes-switch: focusable=true, #3b5cf6ff, thumb x=1106).
    3. Settings search: typing "install updates on quit" in settings-search-input surfaces "Install updates on quit" / "Preferences / Updater" at y=240.
  • Not run: Case 4 (live enabled/signed updater toggle persistence and quit handoff; requires non-isolated signed or debug updater feed), real window, macOS, Linux.
  • Local guardrails (scripts/guardrails.ps1): 9/9 passed; bun scripts/web-clock.ts: 0 violations.

@Hona
Hona marked this pull request as ready for review November 26, 2026 06:14
@Hona
Hona merged commit 78c3e42 into dev Nov 26, 2026
7 checks passed
@Hona
Hona deleted the upstream-f/install-updates-on-quit branch November 26, 2026 06:14
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