fix(shim): skip network resolution for installed tool dirs#9599
Conversation
`Toolset::list_installed_versions` was calling `.resolve()` on each on-disk install — for a stale dir literally named `latest`, this re-queries the registry and fails on 404 (e.g. `facebook/buck2` has no "latest" GitHub release), aborting reshim entirely. The dir name is already the concrete version, so construct `ToolVersion` directly and warn-and-skip on per-tool errors so one bad install can't break the whole rebuild. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request updates the list_installed_versions method in src/toolset/mod.rs to improve performance and robustness. The code now avoids unnecessary network calls by removing the .resolve() call on version strings already present on disk. Additionally, error handling has been improved to log warnings for individual tool failures rather than aborting the entire listing process, and the config parameter is now marked as unused. I have no feedback to provide.
Greptile SummaryThis PR fixes The approach is sound: directory names returned by Confidence Score: 5/5Safe to merge — narrowly scoped fix with no P0/P1 findings and a regression test covering the exact failure scenario. No P0 or P1 issues found. The change correctly eliminates unnecessary network resolution for already-concrete on-disk install versions, the warn-and-skip pattern matches existing codebase conventions, the No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["list_installed_versions()"] --> B["list_current_versions() → HashMap"]
B --> C["for b in backend::list()"]
C --> D["for v in b.list_installed_versions()"]
D --> E{v in current_versions?}
E -- yes --> F["push existing TVTuple"]
E -- no --> G["ToolRequest::new(ba, v, Unknown)"]
G -- Ok --> H["req.version() — normalize ref-X to ref:X"]
H --> I["ToolVersion::new(req, version) — no network, no .resolve()"]
I --> J["push to versions"]
G -- Err --> K["warn! and skip — was: ? propagate → abort"]
F --> L["return Ok(versions)"]
J --> L
K --> L
Reviews (3): Last reviewed commit: "fix(shim): match ToolVersion.version to ..." | Re-trigger Greptile |
Reproduces the buck2 case from the previous commit: a github-backed install dir literally named `latest` registered in the install manifest, combined with `MISE_OFFLINE=1`, makes resolution return `no versions found for buck2`. Verified to fail against the pre-fix `Toolset::list_installed_versions` and pass after. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b76aee4. Configure here.
Hyperfine Performance
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.5.0 x -- echo |
68.3 ± 6.3 | 36.1 | 89.6 | 1.00 |
mise x -- echo |
69.5 ± 6.4 | 38.4 | 98.7 | 1.02 ± 0.13 |
mise env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.5.0 env |
67.2 ± 6.5 | 35.2 | 86.9 | 1.04 ± 0.18 |
mise env |
64.5 ± 8.9 | 26.3 | 105.3 | 1.00 |
mise hook-env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.5.0 hook-env |
69.0 ± 7.1 | 32.1 | 89.6 | 1.00 |
mise hook-env |
69.3 ± 7.0 | 32.7 | 91.3 | 1.01 ± 0.14 |
mise ls
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.5.0 ls |
59.6 ± 6.5 | 31.8 | 73.5 | 1.20 ± 0.25 |
mise ls |
49.9 ± 9.1 | 28.3 | 78.2 | 1.00 |
✅ Performance improvement for ls is 20% |
xtasks/test/perf
| Command | mise-2026.5.0 | mise | Variance |
|---|---|---|---|
| install (cached) | 254ms | 252ms | +0% |
| ls (cached) | 156ms | -14% | |
| bin-paths (cached) | 177ms | 178ms | +0% |
| task-ls (cached) | 870ms | 871ms | +0% |
Cursor Bugbot caught: for install dirs with ref/tag/branch/rev prefixes (e.g. `ref-main`), `ToolRequest::new` normalizes the hyphenated dir name to colon form (`ref:main`) and builds a `Ref` variant whose `request.version()` returns `"ref:main"`. Passing the raw `v` (`"ref-main"`) to `ToolVersion::new` left `tv.version` and `tv.request.version()` inconsistent — the old `.resolve()` path used `request.version()`, so callers (`mise ls`, etc.) expect that invariant. Fix: use `req.version()` as the version field. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
### 🚀 Features - **(backend)** support top-level aqua cosign verification by @risu729 in [#9111](#9111) ### 🐛 Bug Fixes - **(schema)** validate all schema files with draft2020 and strict mode by @risu729 in [#9594](#9594) - **(shim)** skip network resolution for installed tool dirs by @jdx in [#9599](#9599) ### 📚 Documentation - **(dev-tools)** clarify vfox metadata depends for install hooks by @risu729 in [#9573](#9573) - **(plugins)** remove registry submission guidance by @risu729 in [#9577](#9577) ### 📦️ Dependency Updates - lock file maintenance by @renovate[bot] in [#9586](#9586) ### 📦 Registry - remove bashly asdf fallback by @risu729 in [#9578](#9578) - use github backend for rebar by @risu729 in [#9576](#9576) - add wasm-tools ([aqua:bytecodealliance/wasm-tools](https://github.com/bytecodealliance/wasm-tools)) by @2xdevv in [#9596](#9596) - enable symlink_bins for elixir-ls by @AlternateRT in [#9592](#9592) ### Chore - **(release)** always append sponsor block to release notes by @jdx in [#9580](#9580) - warn on vendored vfox embedded plugins by @risu729 in [#9588](#9588) - prefer registry shorthands over cargo/npm backends in mise.toml by @risu729 in [#9595](#9595) ## 📦 Aqua Registry Updates ### New Packages (2) - [`salesforce/reactive-grpc/protoc-gen-reactor-grpc`](https://github.com/salesforce/reactive-grpc) - [`spinframework/spin`](https://github.com/spinframework/spin) ### Updated Packages (1) - [`pnpm/pnpm`](https://github.com/pnpm/pnpm)

Summary
Toolset::list_installed_versionswas callingToolRequest::resolve()on every on-disk install that wasn't part of the current toolset. For a stale install dir literally namedlatest(left over from when a tool was once requested astool = "latest"), this re-queries the registry — and a 404 from the upstream (e.g.facebook/buck2doesn't publish a "latest" GitHub release) bubbles?all the way up and aborts the entire reshim withfailed to rebuild shims: no versions found for buck2.Two issues fixed:
b.list_installed_versions(), which reads~/.mise/installs/<tool>/directory names — i.e. it's already a concrete version. ConstructToolVersion::new(req, v)directly instead of calling.resolve()(no network).ToolRequest::newerrors are now warned-and-skipped, matching the existing pattern atsrc/shims.rs:494-499forlist_tool_bins.Repro (before fix)
After this fix, reshim succeeds and the buck2 shim is created from the on-disk install.
Test plan
cargo test --bin mise toolset— 47 passingmise drno longer reports stale-install resolution failures🤖 Generated with Claude Code
Note
Medium Risk
Changes how
mise reshimdiscovers installed versions by skipping remote resolution and ignoring per-install parse failures, which could affect shim generation for edge-case version directory names. Scope is small but touches core shim rebuild behavior used frequently.Overview
Fixes
mise reshimfailures caused by stale install directories with non-resolvable version names (e.g. an on-disklatestdirectory when offline).Toolset::list_installed_versionsnow treats install dir names as already-concrete versions (no.resolve()/network) and logs+skips per-tool request construction errors instead of aborting the entire shim rebuild.Adds an e2e regression test (
e2e/cli/test_reshim_stale_install) that fabricates a stalebuck2/latestinstall and assertsMISE_OFFLINE=1 mise reshimstill completes and creates shims for a real installed tool.Reviewed by Cursor Bugbot for commit f86e33e. Bugbot is set up for automated code reviews on this repo. Configure here.