hermes - 💡(How to fix) Fix Telegram /model picker silently drops user-defined providers with mixed-case slugs

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

In gateway/platforms/telegram.py, _build_provider_keyboard() builds a lookup dict by_slug using raw provider slugs:

by_slug = {p.get("slug"): p for p in providers}

But group_providers() (from hermes_cli/models.py) lowercases all slugs in its output (line 1034: s = str(slug or "").strip().lower()).

When _build_provider_keyboard looks up a slug returned by group_providers:

p = by_slug.get(row["slug"])  # "bitfun" vs "BitFun" → None

The lookup fails for any provider whose config slug is not already lowercase. Built-in providers (like "openrouter", "anthropic") happen to use lowercase slugs and are unaffected.

Fix Action

Fix

One-line fix in _build_provider_keyboard() — normalize by_slug keys to lowercase:

- by_slug = {p.get("slug"): p for p in providers}
+ by_slug = {p.get("slug", "").lower(): p for p in providers}

Code Example

by_slug = {p.get("slug"): p for p in providers}

---

p = by_slug.get(row["slug"])  # "bitfun" vs "BitFun"None

---

- by_slug = {p.get("slug"): p for p in providers}
+ by_slug = {p.get("slug", "").lower(): p for p in providers}
RAW_BUFFERClick to expand / collapse

Bug Description

After upgrading Hermes, the Telegram /model inline keyboard no longer shows user-defined providers that have mixed-case slugs (e.g., BitFun, Ark.cn-beijing.volces.com). Built-in providers (all lowercase slugs) are unaffected.

Steps to Reproduce

  1. Configure a custom provider with a mixed-case name under providers: in config.yaml
  2. Run Hermes gateway with Telegram platform
  3. Type /model in Telegram
  4. Observe: the custom provider is missing from the provider list

Root Cause

In gateway/platforms/telegram.py, _build_provider_keyboard() builds a lookup dict by_slug using raw provider slugs:

by_slug = {p.get("slug"): p for p in providers}

But group_providers() (from hermes_cli/models.py) lowercases all slugs in its output (line 1034: s = str(slug or "").strip().lower()).

When _build_provider_keyboard looks up a slug returned by group_providers:

p = by_slug.get(row["slug"])  # "bitfun" vs "BitFun" → None

The lookup fails for any provider whose config slug is not already lowercase. Built-in providers (like "openrouter", "anthropic") happen to use lowercase slugs and are unaffected.

Fix

One-line fix in _build_provider_keyboard() — normalize by_slug keys to lowercase:

- by_slug = {p.get("slug"): p for p in providers}
+ by_slug = {p.get("slug", "").lower(): p for p in providers}

Environment

  • Hermes version: v0.15.1
  • Platform: macOS, Telegram gateway

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix Telegram /model picker silently drops user-defined providers with mixed-case slugs