omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

omarchy-mise-install wrapper's bare 'mise use -g <tool>' doesn't refresh to actual latest

Open apeltheory opened this issue 2 months ago • 3 comments

What happened: The wrapper scripts generated by omarchy-mise-install (used for codex, claude, gemini, etc. via install/user/mise.sh) are meant to always run the newest available release — they set MISE_MINIMUM_RELEASE_AGE=0 specifically to bypass mise's release-age cooldown before calling mise use -g "$package". In practice they can get stuck on a stale, already-installed version indefinitely, even though a newer release exists and mise itself knows about it.

Root cause: mise use -g "<tool>" (bare tool name, no version) does not force re-resolution to the newest version once something is already installed/pinned — it appears to just reaffirm the existing pin. mise use -g "<tool>@latest" (explicit @latest) does force the correct re-resolution.

Repro (Omarchy 4.0.2-1, mise 2026.9.1 linux-x64):

$ mise latest claude              # with MISE_MINIMUM_RELEASE_AGE=0
2.1.260
$ mise use -g "claude"            # what the generated wrapper runs
mise ~/.config/mise/config.toml tools: [email protected]   # stale!
$ mise use -g "claude@latest"     # explicit @latest
mise [email protected] ✓ installed  # correct

Same behavior reproduced with the codex wrapper (npm:@openai/codex backend).

Expected: the wrapper should always land on the true latest release, matching its stated intent (the cooldown bypass is pointless otherwise).

Suggested fix: in omarchy-mise-install (/usr/share/omarchy/bin/omarchy-mise-install), change the generated wrapper's mise use -g "$package" / mise x "$package" calls to mise use -g "$package@latest" / mise x "$package@latest".

Workaround in use: manually patched ~/.local/bin/claude and ~/.local/bin/codex to add @latest, which resolves the issue locally.

🤖 Generated with Claude Code

apeltheory avatar Sep 04 '26 04:09 apeltheory

I reproduced the same version-resolution behavior with mise 2026.9.1 linux-x64, using jq as a small independent test case. I used separate temporary mise data, cache, and config directories, ran outside a project, and set MISE_MINIMUM_RELEASE_AGE=0 throughout.

After installing [email protected], I got:

$ mise latest jq
1.8.2
$ mise use -g jq
mise .../config.toml tools: [email protected]
$ mise x jq -- jq --version
jq-1.7.1
$ mise use -g jq@latest
... [email protected] installed
$ mise x jq -- jq --version
jq-1.8.2

Two additional details I confirmed:

  • After the bare mise use -g jq, the config already contained jq = "latest", yet execution still used 1.7.1. This does not require a remaining concrete version pin in the config.
  • In mise v2026.9.1's use implementation, resolution starts with latest_versions: false and use_locked_version: true. An explicitly supplied @latest switches those flags to true and false respectively when locked mode is off; an omitted version creates a latest request without changing those flags. That explains the distinction despite the CLI help saying an omitted version defaults to @latest.

In this isolated case, changing only the use invocation was sufficient: the subsequent bare mise x jq executed the newly installed version. I haven't verified whether that also holds with project-level overrides or lockfiles, so this does not establish that the proposed exec change is unnecessary generally.

The current Omarchy generator still emits the bare package form for both calls. My independent runtime reproduction was with jq, rather than Claude or Codex.

I also checked the related work and am linking it here for coordination:

  • #10168 directly proposes a fix for this issue: explicit @latest for unversioned package specs, preservation of already-versioned specs, and a migration for existing quiet wrappers. I inspected the diff; I have not run that PR's tests.
  • #7360 reports a separate failure in the same generated wrappers: executable lookup can resolve back to the wrapper and loop. #8798 addresses package-scoped binary resolution and supersedes #8692, as noted in #8692's description.
  • #9175 and #9583 are other open PRs addressing that execution-loop problem in the same generator. They are related implementation work, not fixes for the stale-version behavior reproduced above.

Both #10168 and #8798 change bin/omarchy-mise-install and add migrations that recognize the old generated wrapper text. Those changes should be coordinated so existing-wrapper migration coverage survives the combined template changes.

CompleteDotTech avatar Sep 05 '26 04:09 CompleteDotTech

Awesome, thank you so much for looking into this

apeltheory avatar Sep 05 '26 19:09 apeltheory

Checked against current quattro: the bug is still there. bin/omarchy-mise-install writes wrappers that pass the bare package to both mise use -g --quiet and mise x, so MISE_MINIMUM_RELEASE_AGE=0 lifts the cooldown but never makes mise pick a newer version once one is installed. That agrees with the jq reproduction above and with mise's use.rs, where only an explicit @latest turns on latest-version resolution.

#10168 is the open fix for this, and it already closes this issue. It appends @latest to unversioned specs, including scoped npm packages, and migrates the wrappers already on disk. One gap, raised by the second opinion and confirmed in the source: it exempts every spec carrying [options] or http:, so the Muse wrapper (install/user/mise.sh:25, which has no version in its spec) would stay on the bare form and keep this behaviour. That gets settled in #10168's own review, which will run its suite on a worker.

Nothing was run for this issue itself, because the fix is reviewed and tested as part of #10168. Reviewed by Claude Opus 5.5, with a second opinion from Codex Medium that agreed on the cause and contributed the Muse gap; independence between the two is not guaranteed. Next step: waiting on the maintainer to decide on #10168.

omarchybot avatar Oct 11 '26 04:10 omarchybot