Skip to content

fix(http): enhance fetch_versions to to fallback to config for tool options#7655

Merged
jdx merged 3 commits intojdx:mainfrom
roele:issues/7641
Jan 13, 2026
Merged

fix(http): enhance fetch_versions to to fallback to config for tool options#7655
jdx merged 3 commits intojdx:mainfrom
roele:issues/7641

Conversation

@roele
Copy link
Contributor

@roele roele commented Jan 13, 2026

In context of certain commands like ls-remote the BackendArg.opts might be empty which leads to remote versions not being fetched due to missing version_list_url.

This is not the case for tools defined in the registry as those are explicitly serve as base options in BackendArg before overridden by user defined tool options (not including configuration).

Not sure if or how we could move this logic down to BackendArg given the async nature of Config.

Also see discussion #7641


Note

Ensures HTTP backend can list remote versions even when BackendArg.opts lacks version_list_url by falling back to config-defined tool options.

  • Change HttpBackend::fetch_versions to accept Config and resolve options from config.get_tool_opts when version_list_url is missing
  • Update _list_remote_versions to pass config into fetch_versions
  • Add Config::get_tool_opts to retrieve ToolVersionOptions for a given BackendArg
  • Extend e2e test to verify ls-remote works without a registry by defining an http:zmx tool in mise.toml and clearing cache

Written by Cursor Bugbot for commit fd8bdf4. This will update automatically on new commits. Configure here.

Copilot AI review requested due to automatic review settings January 13, 2026 15:15
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances the HTTP backend's fetch_versions method to fallback to tool options from config files when the BackendArg.opts is empty. This addresses an issue where commands like ls-remote don't have options populated in the BackendArg, preventing remote versions from being fetched when version_list_url is only defined in config files.

Changes:

  • Added a new get_tool_opts method to Config to retrieve tool options from the tool request set
  • Modified fetch_versions in the HTTP backend to accept a Config parameter and fallback to config options when BackendArg options are empty
  • Updated _list_remote_versions to pass the config to fetch_versions

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/config/mod.rs Added imports for BackendArg and ToolVersionOptions; implemented get_tool_opts method to retrieve options from config
src/backend/http.rs Modified fetch_versions to accept config parameter and implement fallback logic for empty opts

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…ptions

in context of certain commands like `ls-remote` the `BackendArg.opts` might be empty which leads to remote versions not being fetched due to missing `version_list_url`.
@jdx
Copy link
Owner

jdx commented Jan 13, 2026

bugbot run

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no bugs!

@jdx jdx merged commit 36efbdb into jdx:main Jan 13, 2026
35 checks passed
@roele roele deleted the issues/7641 branch January 13, 2026 22:09
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.

4 participants