HERMES-GIELIE/api
Hermes Bot 0750da5b37 fix(models): structural OpenRouter free-tier visibility — live fetch + augment fallback (#1426)
Augments @bergeouss's PR #1548 v2 with the structural fix the issue
actually requested. The original PR added 5 hardcoded entries to
_FALLBACK_MODELS which would rot fast as OpenRouter's free-tier roster
turns over monthly.

Adds proper live-fetch logic to the OpenRouter group population so the
free-tier list stays fresh without requiring a code release every time
a new free model lands.

api/config.py:2120 — replaces the static _FALLBACK_MODELS slice with:

  1. Live curated catalog via hermes_cli.models.fetch_openrouter_models()
     — applies the tool-support filter (Kilo-Org/kilocode#9068).
  2. Free-tier live fetch — direct call to https://openrouter.ai/api/v1/models,
     filtered to free-tier-only (pricing.prompt == 0 AND pricing.completion
     == 0, OR :free suffix), bypasses the tool-support filter so newly-added
     free variants appear even before OpenRouter annotates them with tools.
     Capped at 30 entries to keep the picker usable.
  3. Defense-in-depth fallback to _FALLBACK_MODELS (which retains
     @bergeouss's hardcoded list for offline / test envs).
  4. Deduplication via seen_ids — model in both surfaces appears once.

5 new tests + 1 fixed test in tests/test_minimax_provider.py (scoped the
provider='MiniMax' assertion to direct-MiniMax routes by filtering for
'minimax/' prefix and excluding ':free' since the OpenRouter free-tier
variant minimax/minimax-m2.5:free correctly carries provider='OpenRouter').

Co-authored-by: bergeouss <[email protected]>
2026-05-03 19:18:44 +00:00
..
__init__.py
agent_sessions.py Harden messaging channel handoff 2026-05-03 16:35:50 +00:00
auth.py fix: serve static assets correctly under /session/* routes 2026-05-03 13:05:15 +08:00
background.py feat(commands): /background, /btw slash commands + undo button + reasoning chip 2026-04-24 01:24:51 +00:00
clarify.py feat(clarify): SSE long-connection for real-time clarify notifications (#1355) 2026-04-30 21:32:51 +00:00
commands.py
config.py fix(models): structural OpenRouter free-tier visibility — live fetch + augment fallback (#1426) 2026-05-03 19:18:44 +00:00
extensions.py Opus pre-release follow-ups for PR #1445 2026-05-02 03:49:40 +00:00
gateway_watcher.py release: v0.50.241 (#1293) 2026-04-29 19:54:07 -07:00
helpers.py v0.50.255: Opus follow-ups (4 fixes) + CHANGELOG 2026-05-01 17:19:53 +00:00
metering.py v0.50.207: batch of 10 PRs — TPS stat, SSE guard, session polish, cron UX, folder create, model errors, session speed, title gen (#1031) 2026-04-25 13:07:35 -07:00
models.py Harden messaging channel handoff 2026-05-03 16:35:50 +00:00
oauth.py v0.50.257: 4 Opus pre-release follow-ups + CHANGELOG + test fixes for #1415 2026-05-01 18:30:41 +00:00
onboarding.py fix(onboarding,probe): refuse HTTP redirects on probe path (reviewer-flagged on PR #1501) 2026-05-03 03:21:22 +00:00
profiles.py fix(cancel-stream): rename tool_calls to _partial_tool_calls (Opus MUST-FIX) 2026-04-30 23:43:23 +00:00
providers.py fix: Nous Portal full live catalog + dropdown cache invalidation on provider remove 2026-05-03 18:12:01 +00:00
rollback.py v0.50.255: Opus follow-ups (4 fixes) + CHANGELOG 2026-05-01 17:19:53 +00:00
routes.py Harden messaging channel handoff 2026-05-03 16:35:50 +00:00
session_ops.py Show profile home in /status command (refs #463) (#1380) 2026-05-01 04:46:37 +00:00
startup.py fix: P0 hotfixes — API regression, code block parser, chmod override 2026-05-01 12:10:48 +00:00
state_sync.py
streaming.py fix(streaming): pass agent.reasoning_effort into WebUI agents (salvages #1531) 2026-05-03 16:34:25 +00:00
terminal.py absorb: address Opus review findings (security + correctness) 2026-04-29 05:06:34 +00:00
updates.py fix: update banner — conflict recovery path + server self-restart after update (#816) 2026-04-21 17:10:41 -07:00
upload.py Merge remote-tracking branch 'refs/remotes/pr/1229' into stage/batch-v0.50.238 2026-04-29 15:17:57 +00:00
workspace.py fix: batch v0.50.234-235 — XSS hardening, workspace validation, profile switch fixes (#1206) 2026-04-27 21:39:30 -07:00