fix(cli): validate user-defined providers consistently (salvage #14857)#15083
Merged
Conversation
This was referenced Apr 24, 2026
19 tasks
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.
Salvage of #14857 by @LeonSGP43 onto current main.
Closes #14850.
What this PR does
Stops
hermes modelandhermes doctorfrom printing false "Unknown provider" warnings for user-definedproviders:entries in config.yaml. Before this PR, the validation/entrypoint paths calledhermes_cli.auth.resolve_provider()(built-in providers only), while the runtime/picker paths correctly usedresolve_provider_full()(user-aware). Same config, two answers.How
select_provider_and_model()inhermes_cli/main.pynow routes throughresolve_provider_full(effective_provider, user_providers, compatible_custom_providers)before falling back toresolve_provider('auto').run_doctor()inhermes_cli/doctor.pygets the same treatment plus extends itsknown_providersset with keys fromproviders:andcustom_providers:.Runtime behavior is unchanged — only validation/display paths were incorrectly strict.
Validation
With the issue's exact config (
provider: volcengine-plan,providers.volcengine-plan.base_url: ark.cn-beijing.volces.com/api/coding/v3):hermes modelpreamblehermes doctortests/hermes_cli/test_doctor.py,test_setup.py— 41/41 pass (4 new regression tests)resolve_provider_full('volcengine-plan')returnsProviderDef(id='volcengine-plan', base_url='...', source='user-config')Co-authored-by: @LeonSGP43