Skip to content

Resolve mise wrappers to @latest on each run - #10168

Open
calledtoconstruct wants to merge 4 commits into
omacom:quattrofrom
calledtoconstruct:fix/mise-wrapper-latest
Open

calledtoconstruct wants to merge 4 commits into
omacom:quattrofrom
calledtoconstruct:fix/mise-wrapper-latest

Conversation

@calledtoconstruct

Copy link
Copy Markdown

mise use -g <tool> reaffirms the installed pin, so wrappers generated by omarchy-mise-install could stay on a stale version even with MISE_MINIMUM_RELEASE_AGE=0. Use <tool>@latest (including scoped npm packages), leave already-versioned specs alone, and rewrite existing quiet wrappers.

Fixes #10112

@calledtoconstruct

Copy link
Copy Markdown
Author

Rebased onto current quattro.

Kept the command-name guard and %q quoting from #7994. @latest is appended only for unversioned package specs; http: / [options] backends (Muse) are left alone. omarchy-remove-preinstalls now matches cursor-agent(@latest)? so Remove Preinstalls still deletes the wrapper we write.

@greptile-apps

greptile-apps Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[High impact] The PR appears safe to merge, with the earlier non-blocking escaped-wrapper issue still outstanding.

Findings

  1. P2 Escaped wrappers remain stale. ▶

Summary

The PR makes unversioned mise wrappers request @latest and adds a migration for existing quiet wrappers.

  • Mise wrappers resolve unversioned tools as @latest on each run.

Reviews (2) · Last reviewed commit: "Look for a version only after a spec's o..." · Reviewed by Greptile

Comment thread migrations/1789093830.sh
Comment on lines +21 to +22
package=$(sed -n 's/^mise use -g --quiet "\(.*\)" || exit 1$/\1/p' <<<"$contents")
bin=$(sed -n 's/^exec mise x ".*" -- "\(.*\)" "\$@"$/\1/p' <<<"$contents")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Escaped wrappers remain stale. If an existing wrapper has a shell-special character in its package or binary name, the installer writes that argument with shell escaping instead of double quotes. These patterns then skip the wrapper, so it keeps using its bare spec and may remain on an older installed version. Please handle the escaped form as well.

@omarchybot omarchybot added the bug Something isn't working label Oct 13, 2026
omarchybot and others added 2 commits October 13, 2026 14:24
mise takes a version after the options, as http:muse[...]@latest, and a spec with options goes stale under a bare `mise use -g` exactly like one without: with github:jqlang/jq[bin=jq]@jq-1.7.1 installed, the bare spec kept running 1.7.1 and the @latest one moved to 1.8.2. Leaving those specs alone kept Muse's wrapper on the behaviour this change fixes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An @ inside [options], as in a URL, made the spec read as already versioned, so its wrapper stayed bare and stale. Only what follows the options can be a version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Codex Medium <noreply@openai.com>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 13, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed and verified on a disposable Omarchy worker with real mise 2026.9.11: this fixes #10112. With jq@1.7.1 already installed, a wrapper from current quattro's omarchy-mise-install kept running 1.7.1, the wrapper from this branch moved to 1.8.2, and putting the old installer back brought the stale version back. mise use -g --dry-run <spec>@latest also resolves for every spec install/user/mise.sh installs, including the cursor-agent alias in etc/mise/conf.d/omarchy.toml and Muse's http: spec. The full ./test/all ran on this branch merged with current quattro (it merges cleanly). Its only failures are the 9 shell tests that fail the same way on quattro itself, plus three signal-timing tests in screenrecording-process-test.sh and ssh-reconnect-test.sh that failed once under load and passed twice in isolation, on both trees.

I pushed two commits to the branch:

  • Muse now gets @latest too. The installer left any spec carrying [options] or http: bare, on the grounds that @latest would mangle it. It doesn't: mise takes the version after the options (http:muse[...]@latest resolves), and an options spec goes stale under a bare mise use -g the same way. With github:jqlang/jq[bin=jq]@jq-1.7.1 installed, the bare spec kept 1.7.1 and the @latest one moved to 1.8.2. So the exemption left Muse's wrapper with the bug this PR fixes. The migration now rewrites a stale Muse wrapper as well, and the tests cover both.
  • An @ inside the options is no longer taken for a version. A spec like http:tool[url=https://example.test/@releases/tool.sh] was read as already versioned and left bare. Only what follows the options can carry a version now.

Not changed: the Greptile note that the migration skips wrappers whose arguments were written with %q escaping. That only happens for a hand-made spec containing $, a backtick, ", \ or !, and no Omarchy caller passes one. Such a wrapper keeps exactly today's behaviour, and running omarchy-mise-install again rewrites it, so parsing escaped shell inside a migration would cost more than it fixes.

Related: #9596 replaces these wrappers with mise's native lazy shims, which would make this change moot if it lands. #14880, #9583, #13614, #13769 and #9175 each change the wrapper's exec line, so whichever of those lands alongside this one needs its migration to recognise the other's template.

Reviewed by Claude Opus 5.5, with a second opinion from Codex Medium over two rounds. Codex raised the @-inside-options case and the %q case, found nothing further on the final head, and otherwise agreed with this review; independence between the two is not guaranteed. CI has not run on this pull request yet; after that, it waits on the maintainer.

@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Oct 14, 2026
quattro added Kimi after this branch was cut. Its Remove Preinstalls check anchored on the bare "npm:@moonshot-ai/kimi-code" spec, so it would have left behind every Kimi wrapper the installer now writes; it accepts the @latest form now, as the cursor-agent check already does. The Kimi tests expect the @latest spec too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Oct 14, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

This branch had stopped merging into quattro, so I merged current quattro into it (6ec7122) and re-verified the result.

The conflict was in test/shell.d/default-agent-test.sh: quattro added Kimi to the lazy-stub list, and the merge keeps it, expecting the @latest spec like the others. Kimi also needed one change outside the conflict. quattro's Remove Preinstalls check in bin/omarchy-remove-preinstalls matched only the bare "npm:@moonshot-ai/kimi-code" spec, so it would have left behind every Kimi wrapper this branch's installer writes. It now accepts (@latest)?, as the cursor-agent check already does, and test/shell.d/kimi-agent-test.sh expects the @latest spec. Without the check change, that test's "Remove Preinstalls removes Omarchy's Kimi wrapper" case fails.

Checked on a disposable Omarchy worker with real mise 2026.9.11, with jq 1.7.1 already installed: the wrapper written by quattro's omarchy-mise-install ran 1.7.1, the merged head's ran 1.8.2, and putting quattro's installer back into the merged tree brought 1.7.1 back. The full ./test/all fails the same three files on the merged head and on quattro itself (ascii-test.sh, branding-about-animation-test.sh, launch-browser-test.sh), none of them related to mise. Every default-agent, Kimi, mise-install, wrapper-migration and agent-account test passes.

Reviewed by Claude Opus 5.5, with a second opinion from Codex Medium on the merge. Codex found no defects. It agreed that nothing else quattro added depends on the wrapper's exact text, and that the PR's wrapper migration and quattro's newer Grok migration (1790863209.sh) are safe in either order. Independence between the two reviews is not guaranteed. CI has not reported on this head. Nothing is left for the author, and it waits on the maintainer.

@omarchybot omarchybot removed ready Good to merge verified Omarchy Triage has verified that this issue is ready for final review labels Oct 25, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

This branch no longer merges into quattro, and I didn't bring it across this time, because quattro has since fixed #10112 another way.

#9596 (da2db1a) replaced the handwritten wrappers with mise's native lazy shims. The default tools are now declared in etc/mise/conf.d/omarchy-tools.toml as version = "latest", and the agent CLIs also carry auto_update = "4h", so mise upgrades them before they run instead of leaving them on the version installed first, which is the problem #10112 reports. migrations/1791382872.sh removes the old wrappers and the tool = "latest" entries they left in the user's config, and agents/skills/mise-tools.md now says not to add handwritten wrappers. No live code on quattro calls omarchy-mise-install anymore. Only the old migrations do.

Landing this branch on quattro now would undo part of that. bin/omarchy-migrate runs migrations in filename order, so migrations/1789093830.sh runs before 1791382872.sh on any machine that hasn't run either. It rewrites each wrapper to "<tool>@latest", and 1791382872.sh removes a wrapper only when the file matches its shipped template byte for byte, with the bare package name. The rewritten wrapper is therefore left in ~/.local/bin, and the first time it runs, its mise use -g --quiet "<tool>@latest" writes back the user-config entry that 1791382872.sh had just removed. That entry outranks Omarchy's declaration. The changed omarchy-mise-install has the same effect on wrappers written by earlier pending migrations, such as 1787573629.sh and 1788577553.sh. The test changes also conflict with #16302, which removed migration tests from the suite.

What was checked: the diff against current quattro (d367a56), read only. Nothing ran, because there was nothing worth running on a worker. Codex Medium and muse-wonder (via pi, thinking high) reviewed the same question as a second opinion. Both reached the same conclusion, but their independence isn't guaranteed. muse-wonder also found that the changed helper affects wrappers written by those earlier migrations. Neither found any hunk still worth porting.

Thank you, @calledtoconstruct. This PR diagnosed the stale-version problem correctly. It's now waiting on the maintainer, and I've recommended closing it, along with #10112, as fixed by #9596.

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants