Skip to content

fix(opencode): support mise-managed upgrades#36573

Open
shanebishop1 wants to merge 4 commits into
anomalyco:devfrom
shanebishop1:mise-autoupdate
Open

fix(opencode): support mise-managed upgrades#36573
shanebishop1 wants to merge 4 commits into
anomalyco:devfrom
shanebishop1:mise-autoupdate

Conversation

@shanebishop1

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #36572

Type of change

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

What does this PR do?

OpenCode currently detects updates for mise-managed installations, but cannot apply them because mise is treated as an unknown installation method.

This PR detects binaries installed through mise and asks mise which config selected the running version. It updates that exact config while preserving its pinned or fuzzy version format. If the source cannot be identified unambiguously, the upgrade fails without modifying or creating a config file.

The existing installation detection sequence is intentionally preserved. On startup, the backend checks for updates while the TUI separately connects to the event stream and registers the listener that opens the update dialog. Returning mise immediately made the check complete before that listener was ready, so the one-shot update event was lost and no popup appeared. Keeping the existing sequence preserves current startup ordering; adding an explicit TUI readiness handshake would be the cleaner long-term fix, but felt out of scope here.

Ambiguous sources fail rather than falling back to mise install, since installing without activating the target would misleadingly report a successful upgrade.

How did you verify your code works?

Added focused tests and manually verified the full update popup flow from a mise-managed 1.17.14 installation to 1.17.18.

Screenshots / recordings

N/A

Checklist

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

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.

Bug: OpenCode throws error when attempting to update mise-managed installations

1 participant