Skip to content

feat(cli): add list_picker_providers for credential-filtered picker (salvage #13561)#20298

Merged
teknium1 merged 2 commits into
mainfrom
salvage/pr-13561
May 5, 2026
Merged

feat(cli): add list_picker_providers for credential-filtered picker (salvage #13561)#20298
teknium1 merged 2 commits into
mainfrom
salvage/pr-13561

Conversation

@teknium1
Copy link
Copy Markdown
Contributor

@teknium1 teknium1 commented May 5, 2026

Salvages @Tkander1715's PR #13561 onto current main.

What it does

The Telegram/Discord /model interactive pickers called list_authenticated_providers(), which included OpenRouter IDs the live catalog no longer carries and providers with zero callable models. The picker then showed selections that 404'd on use.

Adds list_picker_providers() as a post-processor: OpenRouter models come from fetch_openrouter_models() (live-catalog-filtered), empty-models rows are dropped (except custom endpoints where users type IDs manually), everything else passes through. Gateway's interactive-picker call site switches; typed /model <name> and text-fallback listings stay on the base function so power users aren't gated.

Changes

  • hermes_cli/model_switch.py — new list_picker_providers helper.
  • gateway/run.py — picker code path uses the new helper.
  • tests/hermes_cli/test_list_picker_providers.py — 9 focused tests.
  • scripts/release.py — AUTHOR_MAP entry for Tkander1715.

Validation

tests/hermes_cli/ -k 'authenticated or picker' — 109 passed locally.

Closes #13561 via salvage.

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard comp/gateway Gateway runner, session dispatch, delivery labels May 5, 2026
Traemond Anderson and others added 2 commits May 5, 2026 10:18
The Telegram/Discord /model pickers currently call
list_authenticated_providers(), which returns every provider whose
credentials resolve locally and every model in its curated snapshot.
Two failure modes fall out:

- OpenRouter rows can include IDs the live catalog no longer carries.
- Provider rows can surface with zero callable models (e.g. a slug
  whose credential pool entry exists but has nothing behind it).

list_picker_providers() wraps the base function and post-processes the
result so the interactive picker only shows models the user can
actually select:

- OpenRouter's models come from fetch_openrouter_models() (live-catalog
  filtered against the curated OPENROUTER_MODELS snapshot).
- Rows with an empty models list are dropped, except custom endpoints
  (is_user_defined=True with an api_url) where the user may enter
  model ids manually.
- All other fields pass through unchanged.

The gateway /model handler switches to the new helper for the
interactive picker payload only. Typed /model <name> and the text
fallback list stay on list_authenticated_providers() so nothing is
hidden from power users or platforms without a picker.

Covered by nine focused unit tests in
tests/hermes_cli/test_list_picker_providers.py.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@teknium1 teknium1 force-pushed the salvage/pr-13561 branch from 940f3fb to 81ffb09 Compare May 5, 2026 17:18
@teknium1 teknium1 merged commit 87b113c into main May 5, 2026
9 of 10 checks passed
@teknium1 teknium1 deleted the salvage/pr-13561 branch May 5, 2026 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard comp/gateway Gateway runner, session dispatch, delivery 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