fix(completion): avoid network calls when generating completions#10010
Conversation
Co-authored-by: sargunv-headway <sargunv-headway@users.noreply.github.com>
Co-authored-by: sargunv-headway <sargunv-headway@users.noreply.github.com>
Greptile SummaryThis PR sets
Confidence Score: 5/5Safe to merge — the change is a one-liner that sets an already-supported offline flag on a path that only needs local tool resolution. The modification is minimal: it opts in to an existing offline resolution mode already used by other commands such as prune. The completion command only needs the tool environment to locate usage; it never reads freshly fetched remote version lists, so disabling them is a pure latency win with no behavioral regression. No files require special attention. Important Files Changed
Reviews (1): Last reviewed commit: "fix(completion): clarify offline resolut..." | Re-trigger Greptile |
There was a problem hiding this comment.
Code Review
This pull request updates the shell completion generation in src/cli/completion.rs to use offline resolution when building the toolset. By configuring ToolsetBuilder with offline: true, the change prevents network fetches during shell startup, ensuring a faster and more reliable completion process. I have no feedback to provide as there were no review comments to evaluate.
### 🚀 Features - **(npm)** disable npm lifecycle scripts by default by @risu729 in [#9913](#9913) ### 🐛 Bug Fixes - **(completion)** avoid network calls when generating completions by @sargunv-headway in [#10010](#10010) - **(config)** track install manifest option source by @risu729 in [#9958](#9958) - **(doctor)** honor http timeout for version checks by @risu729 in [#9977](#9977) - **(github)** prefer primary binary assets by @risu729 in [#10008](#10008) - **(release)** bake secondary mise-plugins vfox plugins by @risu729 in [#9832](#9832) - **(shim)** preserve optioned aliases during rebuilds by @risu729 in [#9848](#9848) ### 🚜 Refactor - **(dotnet)** parse backend tool options locally by @risu729 in [#9962](#9962) ### 📚 Documentation - remove how i use mise article by @jdx in [#9996](#9996) ### 🧪 Testing - **(s3)** cover current config over install manifest opts by @risu729 in [#9917](#9917) ### 📦️ Dependency Updates - update astral-tokio-tar by @jdx in [#9997](#9997) ### 📦 Registry - update entry for vale by @eread in [#10002](#10002) - use aqua backend for vector by @jdx in [#10011](#10011) ## 📦 Aqua Registry Updates ### New Packages (2) - `google.com/antigravity-cli` - [`sholdee/crd-schema-publisher`](https://github.com/sholdee/crd-schema-publisher) ### Updated Packages (4) - [`FairwindsOps/pluto`](https://github.com/FairwindsOps/pluto) - [`goccy/bigquery-emulator`](https://github.com/goccy/bigquery-emulator) - [`sourcemeta/jsonschema`](https://github.com/sourcemeta/jsonschema) - [`wasmCloud/wasmCloud/wash`](https://github.com/wasmCloud/wasmCloud)
Summary
mise completionis often run on shell init, where network calls while resolving the toolset delay every shell startup. Here we avoid refreshing remote version metadata while generating shell completions.mise completionbuilds the active toolset only to provide an environment for runningusage generate completion. Ifusageis unavailable, completion generation already falls back to the prerendered completions.Verification
RUSTUP_TOOLCHAIN=stable target/debug/mise run lint-fixMISE_LOG_LEVEL=debug MISE_FETCH_REMOTE_VERSIONS_TIMEOUT=1 target/debug/mise completion zsh