fix: include custom_providers in /model command listings and resolution#7088
Merged
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.
- Add custom_provider_slug() to hermes_cli/providers.py as the single source of truth for building 'custom:<name>' slugs. - Use it in resolve_custom_provider() and list_authenticated_providers() instead of duplicated inline slug construction. - Add _session_model_overrides and _voice_mode to gateway test runner for object.__new__() safety.
Contributor
|
This was referenced Apr 12, 2026
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.
Summary
Salvage of PR #6807 by @rahimsais (commit by donrhmexe). Cherry-picked onto current main with follow-up fixes.
What this PR does: Custom providers defined under
custom_providers:in config.yaml were invisible to the/modelslash command in both CLI and gateway. You could configure a local LLM server but couldn't switch to it via/model.Changes
Cherry-picked from #6807:
hermes_cli/providers.py— Addresolve_custom_provider()and extendresolve_provider_full()to check custom_providershermes_cli/model_switch.py— Propagatecustom_providersthroughswitch_model(),list_authenticated_providers(),get_authenticated_provider_slugs(); add custom provider section to listings with proper slug, name, and default modelgateway/run.py— Readcustom_providersfrom config and pass to all model-switch callscli.py— Hoist config loading to read bothprovidersandcustom_providers; pass both to listing and switch callsFollow-up fixes:
custom_provider_slug()helper inhermes_cli/providers.py— single source of truth for buildingcustom:<name>slugs, replacing duplicated inline slug constructionresolve_custom_provider()had a logic error wherecanonical = normalize_provider(name)was added to every entry's comparison set, causing the first custom provider to always match any display name input. Fixed by removing the stalecanonicalfrom the comparison._session_model_overridesand_voice_modeto_make_runner()forobject.__new__()safetyTest plan
Closes #6807