fix: include custom_providers in /model command listings and resolution#6807
Closed
rahimsais wants to merge 1 commit into
Closed
fix: include custom_providers in /model command listings and resolution#6807rahimsais wants to merge 1 commit into
rahimsais wants to merge 1 commit into
Conversation
Custom providers defined in config.yaml under were completely invisible to the /model command in both gateway (Telegram, Discord, etc.) and CLI. The provider listing skipped them and explicit switching via --provider failed with "Unknown provider". Root cause: gateway/run.py, cli.py, and model_switch.py only read the dict from config, ignoring entirely. Changes: - providers.py: add resolve_custom_provider() and extend resolve_provider_full() to check custom_providers after user_providers - model_switch.py: propagate custom_providers through switch_model(), list_authenticated_providers(), and get_authenticated_provider_slugs(); add custom provider section to provider listings - gateway/run.py: read custom_providers from config, pass to all model-switch calls - cli.py: hoist config loading, pass custom_providers to listing and switch calls Tests: 4 new regression tests covering listing, resolution, and gateway command handler. All 71 tests pass.
eda8f19 to
2be060d
Compare
Contributor
|
Merged via PR #7088. Your commit was cherry-picked onto current main with your authorship preserved in git log. Follow-up fixes added: extracted shared slug helper, fixed a resolution bug where the first custom provider would match any display-name input, and hardened the gateway test. Thanks for the contribution @rahimsais! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Custom providers defined in
config.yamlundercustom_providers:were invisible to the/modelcommand in both gateway (Telegram, Discord, etc.) and CLI. Explicit switching via--providerfailed with "Unknown provider".Root Cause
gateway/run.py,cli.py, andmodel_switch.pyonly read theproviders:dict from config, ignoringcustom_providers:entirely. The resolution chain inproviders.pyalso had no step for custom providers.Changes
hermes_cli/providers.pyresolve_custom_provider()to match custom providers by name or slug (custom:<display-name>)resolve_provider_full()to check custom_providers after user_providers in the resolution chainhermes_cli/model_switch.pycustom_providersthroughswitch_model(),list_authenticated_providers(), andget_authenticated_provider_slugs()gateway/run.pycustom_providersfrom config.yamlcli.pyprovidersandcustom_providersTests
4 new regression tests:
test_list_authenticated_providers_includes_custom_providers— verifies custom providers appear in listingstest_switch_model_explicit_custom_provider_resolution— verifies explicit--provider custom:slugresolvestest_switch_model_custom_provider_label— verifies display name used in resulttest_handle_model_command_lists_saved_custom_provider— verifies gateway command handler includes custom providersAll 71 tests pass (67 existing + 4 new).
Example Config
Now shows up as
custom:local-(127.0.0.1:4141)in/modellistings and is switchable.