fix(config): default release age cutoff should not disable installed-version resolution#10315
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
🚧 Files skipped from review as they are similar to previous changes (6)
📝 WalkthroughWalkthroughTracks the source of the resolved install "before" cutoff (Provided, Explicit, Default), preserves provenance in ResolveOptions, uses it to decide whether installed versions are filtered, updates CLI callers to opt out of default-based filtering, and adds e2e tests preventing unnecessary remote version-list fetches. ChangesBefore-date provenance tracking
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
Greptile SummaryThis PR fixes a performance regression introduced in #10279 where the built-in 24h
Confidence Score: 5/5Safe to merge. The change is narrowly scoped to the installed-version fast-path guards, well-covered by two new regression e2e tests that were verified to fail on unfixed code, and the refactor to The core logic is sound: The Important Files Changed
Reviews (2): Last reviewed commit: "refactor(upgrade): use apply_before_date..." | Re-trigger Greptile |
…version resolution The built-in 24h minimum_release_age default (#10279) set a before_date on every resolution, which disabled the installed-version fast paths for all non-prefer-offline commands (mise which, mise use, ...). Every invocation then fetched remote version lists for the entire toolset, turning ~75ms shell-startup calls into ~2.5s each (reported as ~65s shell startups in discussion #10308). The built-in default now only gates which versions remote resolution may pick — its actual purpose of delaying new installs. Explicit cutoffs (the --minimum-release-age flag, a per-tool minimum_release_age option, or the minimum_release_age setting) keep their date-aware resolution semantics from #9269, since opting in was a deliberate choice there. - install_before: cutoff resolution reports a BeforeDateSource (Provided/Explicit/Default) alongside the timestamp - ResolveOptions: new before_date_from_default flag, set via a shared apply_before_date_for_tool helper; the should_filter_installed_versions gates in resolve_version/resolve_prefix require an explicit cutoff - e2e: test_which_no_remote_fetch pins the regression (fails on unfixed code); test_hook_env_no_remote_fetch guards the prefer-offline paths so hook-env can never start fetching remote versions Fixes #10308 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
15da3ee to
d44b36b
Compare
…arning Keeps before_date_from_default provenance consistent in the upgrade warning path instead of reconstructing ResolveOptions with the provenance-less resolver. Inert today (latest_versions=true bypasses the installed-version gates) but prevents a future caller of latest_for_upgrade from inheriting broken provenance. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Addressed the Greptile finding: the upgrade hidden-version warning path now uses This comment was generated by an AI coding assistant. |
Hyperfine Performance
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.6.2 x -- echo |
21.0 ± 1.6 | 18.7 | 28.3 | 1.00 |
mise x -- echo |
24.0 ± 3.9 | 19.3 | 57.3 | 1.14 ± 0.21 |
x -- echo measured 14% slower, but hyperfine reported statistical outliers. |
mise env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.6.2 env |
20.5 ± 1.2 | 18.5 | 26.8 | 1.00 |
mise env |
20.6 ± 1.2 | 18.5 | 25.3 | 1.01 ± 0.08 |
mise hook-env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.6.2 hook-env |
20.5 ± 1.1 | 18.5 | 25.7 | 1.00 |
mise hook-env |
21.1 ± 1.1 | 19.2 | 27.1 | 1.03 ± 0.08 |
mise ls
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.6.2 ls |
16.9 ± 1.0 | 15.1 | 22.9 | 1.00 |
mise ls |
18.9 ± 1.4 | 16.4 | 27.8 | 1.12 ± 0.11 |
ls measured 12% slower, but the relative uncertainty overlaps the 10% threshold. |
xtasks/test/perf
| Command | mise-2026.6.2 | mise | Variance |
|---|---|---|---|
| install (cached) | 146ms | 149ms | -2% |
| ls (cached) | 66ms | 66ms | +0% |
| bin-paths (cached) | 79ms | 83ms | -4% |
| task-ls (cached) | 140ms | 144ms | -2% |
|
Re the hyperfine flags (
No regression (the deltas favor the PR slightly, likely noise). The CI baseline is the released 2026.6.2 binary rather than merge-base, so its delta also includes everything on main since the release. This comment was generated by an AI coding assistant. |
Summary
Fixes the performance regression reported in #10308: upgrading 2026.6.1 → 2026.6.2 took shell startups from ~2.5s to ~65s.
The built-in 24h
minimum_release_agedefault (#10279) set abefore_dateon every tool resolution, which flippedshould_filter_installed_versionson for all non-prefer-offline commands (mise which,mise use, ...). That disabled the installed-version fast paths, so every invocation fetched remote version lists for the entire toolset — ~75ms shell-startup calls became ~2.5s each.The fix
Cutoff resolution now reports where the cutoff came from (
BeforeDateSource::Provided/Explicit/Default):--minimum-release-age, a per-toolminimum_release_ageoption, or theminimum_release_agesetting) keep their date-aware resolution semantics from feat(cli): add minimum release age flag to lock and ls-remote #9269, since opting in was a deliberate choice there.ResolveOptionsgains abefore_date_from_defaultflag (set via a sharedapply_before_date_for_toolhelper, also visible in trace output asbefore_date=... (default)), and the twoshould_filter_installed_versionsgates inresolve_version/resolve_prefixnow require an explicit cutoff.Tests
test_which_no_remote_fetchpins the regression using aqua-backed jq (subject to the built-in default): installed match + fuzzy request must resolve from disk with zero remote version fetches. Verified it fails on unfixed code (which resolved remotely to a non-installed jq) and passes with the fix.test_hook_env_no_remote_fetchguards the prefer-offline paths: a spy copy of the dummy plugin records a marker if its version-listing scripts ever run duringmise hook-env, with and without a release-age cutoff, acrosslatest/prefix/exact requests. Verified it fails if hook-env is removed from the prefer-offline list.test_install_before*,test_install_prefer_offline_no_refresh,test_ls_remote,test_upgrade*,test_outdated,test_which), and lint pass.Manually verified both directions with an aqua tool: default cutoff → local resolution, no fetch; explicit
MISE_MINIMUM_RELEASE_AGE=24h→ date-aware remote resolution (unchanged).Fixes #10308
🤖 Generated with Claude Code
Note
Medium Risk
Changes core version-resolution behavior for all tools on aqua-like backends; explicit minimum_release_age semantics are preserved but the default path is subtly different from 2026.6.2.
Overview
Fixes a performance regression (#10308) where the built-in 24h
minimum_release_agedefault treated every resolution as date-filtered, skipped installed-version fast paths, and triggered remote version-list fetches on commands likemise whichandmise hook-env.Cutoff resolution now records provenance via
BeforeDateSourceandResolveOptions.before_date_from_default. The built-in default still appliesbefore_datefor remote picks at install time, butfilters_installed_versions()only runs for explicit cutoffs (CLI, setting, or per-tool option)—not for the default—so fuzzy requests can resolve from disk when an install already matches.Resolution paths use shared
apply_before_date_for_toolinstead of overwritingbefore_dateblindly; upgrade warnings use the same helper. E2e tests assertmise whichandmise hook-envdo not refetch remote versions when a local install satisfies the request.Reviewed by Cursor Bugbot for commit 0d075c0. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit
Bug Fixes
hook-envandwhichwhen an installed tool already satisfies the request, improving reliability and performance.Tests