Skip to content

fix(model): probe no-key custom provider catalogs - #55158

Closed
ooiuuii wants to merge 1 commit into
NousResearch:mainfrom
ooiuuii:fix/custom-provider-no-key-probe
Closed

fix(model): probe no-key custom provider catalogs#55158
ooiuuii wants to merge 1 commit into
NousResearch:mainfrom
ooiuuii:fix/custom-provider-no-key-probe

Conversation

@ooiuuii

@ooiuuii ooiuuii commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes custom_providers: model picker discovery for no-key local/OpenAI-compatible endpoints.

The Section 4 picker grouping already documents that singular model: is only the active model, while models: is the explicit configured catalog. The probe gate still used the combined grp['models'] list, so a no-key local provider with only model: skipped /v1/models discovery and /model showed only one active model.

This tracks whether a grouped custom provider actually has an explicit models: catalog and only suppresses no-key live discovery for that explicit list. Singular model: no longer blocks live discovery.

Fixes #40542.

Related Issue

Fixes #40542

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • Tests (adding or improving test coverage)

Changes Made

  • hermes_cli/model_switch.py
    • Adds a has_explicit_models flag to Section 4 custom-provider groups.
    • Sets the flag only for explicit models: dict/list entries, not singular model:.
    • Uses that flag for the no-key live discovery gate.
  • tests/hermes_cli/test_model_switch_custom_providers.py
    • Keeps the file offline by default with a fetch_api_models stub.
    • Adds regression coverage proving no-key custom_providers with only singular model: still probe /v1/models and use the live catalog.

How to Test

Run:

python -m pytest tests/hermes_cli/test_model_switch_custom_providers.py -q
python -m pytest tests/hermes_cli/test_user_providers_model_switch.py -q
ruff check hermes_cli/model_switch.py tests/hermes_cli/test_model_switch_custom_providers.py
git diff --check
python scripts/check-windows-footguns.py --diff origin/main

Validation

  • tests/hermes_cli/test_model_switch_custom_providers.py — 29 passed
  • tests/hermes_cli/test_user_providers_model_switch.py — 35 passed
  • ruff check hermes_cli/model_switch.py tests/hermes_cli/test_model_switch_custom_providers.py — pass
  • git diff --check — pass
  • python scripts/check-windows-footguns.py --diff origin/main — pass

Autoreview note: no repository-local autoreview helper was present in this checkout.

@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard area/config Config system, migrations, profiles P3 Low — cosmetic, nice to have labels Jun 29, 2026
@kshitijk4poor

Copy link
Copy Markdown
Collaborator

Merged via #61928. Your focused implementation was cherry-picked and rebase-merged with authorship preserved; follow-up commits fixed declaration-before-dedup and strengthened probe-policy isolation. Thank you!

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 P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: /model picker only shows 1 model for local custom providers without api_key (while hermes model CLI shows all)

3 participants