Skip to content

fix(cli): validate user-defined providers consistently (salvage #14857)#15083

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-37dfb080
Apr 24, 2026
Merged

fix(cli): validate user-defined providers consistently (salvage #14857)#15083
teknium1 merged 1 commit into
mainfrom
hermes/hermes-37dfb080

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Salvage of #14857 by @LeonSGP43 onto current main.

Closes #14850.

What this PR does

Stops hermes model and hermes doctor from printing false "Unknown provider" warnings for user-defined providers: entries in config.yaml. Before this PR, the validation/entrypoint paths called hermes_cli.auth.resolve_provider() (built-in providers only), while the runtime/picker paths correctly used resolve_provider_full() (user-aware). Same config, two answers.

How

  • select_provider_and_model() in hermes_cli/main.py now routes through resolve_provider_full(effective_provider, user_providers, compatible_custom_providers) before falling back to resolve_provider('auto').
  • run_doctor() in hermes_cli/doctor.py gets the same treatment plus extends its known_providers set with keys from providers: and custom_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):

Before After
hermes model preamble "Warning: Unknown provider 'volcengine-plan'..." silent
hermes doctor "model.provider points to a provider not found in config" silent
Picker + runtime worked worked
  • tests/hermes_cli/test_doctor.py, test_setup.py — 41/41 pass (4 new regression tests)
  • E2E: resolve_provider_full('volcengine-plan') returns ProviderDef(id='volcengine-plan', base_url='...', source='user-config')
  • E2E: doctor run no longer emits the 'not a recognised provider' line

Co-authored-by: @LeonSGP43

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/cli CLI entry point, hermes_cli/, setup wizard area/config Config system, migrations, profiles labels Apr 24, 2026
@teknium1 teknium1 merged commit ccc8fcc into main Apr 24, 2026
11 of 12 checks passed
@teknium1 teknium1 deleted the hermes/hermes-37dfb080 branch April 24, 2026 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom providers in config.providers are misclassified as unknown by hermes model and doctor

3 participants