Skip to content

feat(model-picker): add display.model_picker_providers allowlist#20703

Closed
tymrtn wants to merge 1 commit into
NousResearch:mainfrom
tymrtn:feat/model-picker-allowlist
Closed

feat(model-picker): add display.model_picker_providers allowlist#20703
tymrtn wants to merge 1 commit into
NousResearch:mainfrom
tymrtn:feat/model-picker-allowlist

Conversation

@tymrtn

@tymrtn tymrtn commented May 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Add an optional config key — display.model_picker_providers — that restricts the interactive /model picker (the inline keyboard surfaced by Telegram/Discord and other gateway adapters) to a user-chosen set of provider slugs.

When many providers are authenticated, the inline picker can balloon to dozens of rows. This lets the user scope the picker down to the handful they actually use from chat without affecting the typed /model <name> flow.

Behavior

  • Set (list or comma-separated string): only those provider slugs are shown in the picker.
  • Current provider always included — the user never loses their currently-active row even if it isn't in the allowlist.
  • Empty / missing: legacy unfiltered behavior is preserved.
  • Slugs are matched case-insensitively.
  • Only the interactive picker is filtered; typed /model <name> switches are unaffected.

Config example

display:
  model_picker_providers:
    - openai
    - anthropic
    - openrouter

A comma-separated string also works: model_picker_providers: "openai, anthropic, openrouter".

Tests

tests/hermes_cli/test_list_picker_providers.py (extended, all 14 tests green):

  • allowlist filters to listed providers
  • current provider is always included even when excluded by the allowlist
  • empty/missing allowlist => no filter (legacy behavior preserved)
  • comma-separated string form is accepted
$ pytest -q tests/hermes_cli/test_list_picker_providers.py
14 passed in 1.89s

Docs

Adds a short "Model Picker Allowlist" section to website/docs/user-guide/configuration.md.

Related

Closes the long-standing ask in #12655, #15267, #16608 — pluggable / configurable scope for the /model chat picker.

Add an optional config key, display.model_picker_providers, that
restricts the interactive /model picker (the inline keyboard surfaced by
Telegram/Discord and other gateway adapters) to a user-chosen set of
provider slugs.

Behavior:
- Set to a list or comma-separated string: only those provider slugs are
  shown in the picker. The currently-active provider is always included
  so the user never loses their current row.
- Empty or missing: legacy behavior — all authenticated providers are
  listed.
- Slugs are matched case-insensitively.
- Only the interactive picker is filtered; typed '/model <name>'
  switches are unaffected.

Useful when many providers are authenticated but only a handful are
worth surfacing in a quick chat picker.

Refs: NousResearch#12655, NousResearch#15267, NousResearch#16608
@tymrtn

tymrtn commented May 6, 2026

Copy link
Copy Markdown
Contributor Author

Closing — this allowlist is a bandaid. Tyler pointed out the actual bug: the model picker is showing providers that aren't authenticated at all. Root cause: section 1 (api_key auth path) of list_authenticated_providers in hermes_cli/model_switch.py checks hermes_id in store.get('credential_pool', {}) — but empty list values pass that check. Sister fix #46072425f addressed sections 2 and 2b but missed section 1.

Filing a focused fix instead. Tracked separately.

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/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants