Skip to content

fix(completion): avoid network calls when generating completions#10010

Merged
jdx merged 2 commits into
jdx:mainfrom
sargunv-headway:cursor/sv/offline-completion-resolution-b3a3
May 21, 2026
Merged

fix(completion): avoid network calls when generating completions#10010
jdx merged 2 commits into
jdx:mainfrom
sargunv-headway:cursor/sv/offline-completion-resolution-b3a3

Conversation

@sargunv-headway

Copy link
Copy Markdown
Contributor

Summary

mise completion is 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 completion builds the active toolset only to provide an environment for running usage generate completion. If usage is unavailable, completion generation already falls back to the prerendered completions.

Verification

  • RUSTUP_TOOLCHAIN=stable target/debug/mise run lint-fix
  • MISE_LOG_LEVEL=debug MISE_FETCH_REMOTE_VERSIONS_TIMEOUT=1 target/debug/mise completion zsh
    • confirmed no remote GET/WARN output

cursoragent and others added 2 commits May 20, 2026 23:36
Co-authored-by: sargunv-headway <sargunv-headway@users.noreply.github.com>
Co-authored-by: sargunv-headway <sargunv-headway@users.noreply.github.com>
@greptile-apps

greptile-apps Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR sets offline: true on the ResolveOptions used when mise completion builds its toolset, preventing remote version metadata fetches that were slowing down shell startup. The toolset is only needed to locate usage in the environment, so skipping remote resolution has no functional impact; if usage is unavailable the command already falls back to pre-rendered completions.

  • ResolveOptions { offline: true, ..Default::default() } is passed to ToolsetBuilder::with_resolve_options, matching the same pattern used elsewhere (e.g. prune) to skip remote version listing without changing any installed-tool state.
  • No other code paths are touched; the full_env call that follows still correctly builds PATH from locally resolved tool versions.

Confidence Score: 5/5

Safe 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

Filename Overview
src/cli/completion.rs Adds offline: true to ResolveOptions when building the toolset for completion generation, preventing remote version fetches on shell startup.

Reviews (1): Last reviewed commit: "fix(completion): clarify offline resolut..." | Re-trigger Greptile

@gemini-code-assist gemini-code-assist Bot left a comment

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.

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.

@jdx jdx merged commit 289e323 into jdx:main May 21, 2026
32 checks passed
mise-en-dev added a commit that referenced this pull request May 21, 2026
### 🚀 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants