Skip to content

fix(models): preserve OpenRouter variant tags (:free, :extended, :fast) during model switch#6383

Merged
teknium1 merged 1 commit into
mainfrom
hermes/hermes-e77429d5
Apr 9, 2026
Merged

fix(models): preserve OpenRouter variant tags (:free, :extended, :fast) during model switch#6383
teknium1 merged 1 commit into
mainfrom
hermes/hermes-e77429d5

Conversation

@teknium1

@teknium1 teknium1 commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes the bug reported on Discord and identified in PR #6088: OpenRouter model IDs with variant suffixes like :free, :extended, :fast were being mangled during /model switching.

Root cause: model_switch.py Step c blindly converted the first colon to a slash for aggregator providers, even when the model already had a slash (meaning it was already in vendor/model format). So nvidia/nemotron-3-super-120b-a12b:free became nvidia/nemotron-3-super-120b-a12b/free → 400 Bad Request.

Fix: One-line guard — skip colon→slash conversion when the model already contains a /. The module docstring already documented this intent ("colons are reserved for OpenRouter variant suffixes") but the implementation didn't enforce it.

Note: PR #6088 identified the same bug but placed the fix in model_normalize.py, which is only called after model_switch.py has already mangled the model. The fix needs to be in Step c of switch_model() where the mangling actually occurs.

Changes

  • hermes_cli/model_switch.py — added and "/" not in raw_input guard to Step c
  • tests/hermes_cli/test_model_switch_variant_tags.py — 7 tests covering :free, :extended, :fast tags, legacy colon format, and bare model names

Test plan

python -m pytest tests/hermes_cli/test_model_switch_variant_tags.py -v  # 7 passed
python -m pytest tests/hermes_cli/test_model_normalize.py tests/hermes_cli/test_model_validation.py tests/hermes_cli/test_models.py tests/hermes_cli/test_gemini_provider.py -v  # 167 passed

…t) during model switch

Step c in switch_model() blindly converted the first colon to a slash for
aggregator providers, even when the model name already contained a slash
(vendor/model format). This mangled variant tags like :free into /free,
causing 400 Bad Request from the API.

Fix: skip the colon→slash conversion when the model already has a slash,
since the colon is a variant tag, not a vendor separator. The module
docstring already documented this intent (line 17-18) but the
implementation didn't enforce it.

Reported via Discord. Related to PR #6088 (which identified the same bug
but placed the fix in model_normalize.py instead of model_switch.py where
the actual mangling occurs).
@teknium1 teknium1 merged commit 980fadf into main Apr 9, 2026
4 of 6 checks passed
Tommyeds pushed a commit to Tommyeds/hermes-agent that referenced this pull request Apr 12, 2026
…t) during model switch (NousResearch#6383)

Step c in switch_model() blindly converted the first colon to a slash for
aggregator providers, even when the model name already contained a slash
(vendor/model format). This mangled variant tags like :free into /free,
causing 400 Bad Request from the API.

Fix: skip the colon→slash conversion when the model already has a slash,
since the colon is a variant tag, not a vendor separator. The module
docstring already documented this intent (line 17-18) but the
implementation didn't enforce it.

Reported via Discord. Related to PR NousResearch#6088 (which identified the same bug
but placed the fix in model_normalize.py instead of model_switch.py where
the actual mangling occurs).
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 2026
…t) during model switch (NousResearch#6383)

Step c in switch_model() blindly converted the first colon to a slash for
aggregator providers, even when the model name already contained a slash
(vendor/model format). This mangled variant tags like :free into /free,
causing 400 Bad Request from the API.

Fix: skip the colon→slash conversion when the model already has a slash,
since the colon is a variant tag, not a vendor separator. The module
docstring already documented this intent (line 17-18) but the
implementation didn't enforce it.

Reported via Discord. Related to PR NousResearch#6088 (which identified the same bug
but placed the fix in model_normalize.py instead of model_switch.py where
the actual mangling occurs).
02356abc pushed a commit to 02356abc/hermes-agent that referenced this pull request May 14, 2026
…t) during model switch (NousResearch#6383)

Step c in switch_model() blindly converted the first colon to a slash for
aggregator providers, even when the model name already contained a slash
(vendor/model format). This mangled variant tags like :free into /free,
causing 400 Bad Request from the API.

Fix: skip the colon→slash conversion when the model already has a slash,
since the colon is a variant tag, not a vendor separator. The module
docstring already documented this intent (line 17-18) but the
implementation didn't enforce it.

Reported via Discord. Related to PR NousResearch#6088 (which identified the same bug
but placed the fix in model_normalize.py instead of model_switch.py where
the actual mangling occurs).
olympus-terminal pushed a commit to olympus-terminal/hermes-agent that referenced this pull request May 16, 2026
…t) during model switch (NousResearch#6383)

Step c in switch_model() blindly converted the first colon to a slash for
aggregator providers, even when the model name already contained a slash
(vendor/model format). This mangled variant tags like :free into /free,
causing 400 Bad Request from the API.

Fix: skip the colon→slash conversion when the model already has a slash,
since the colon is a variant tag, not a vendor separator. The module
docstring already documented this intent (line 17-18) but the
implementation didn't enforce it.

Reported via Discord. Related to PR NousResearch#6088 (which identified the same bug
but placed the fix in model_normalize.py instead of model_switch.py where
the actual mangling occurs).
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
…t) during model switch (NousResearch#6383)

Step c in switch_model() blindly converted the first colon to a slash for
aggregator providers, even when the model name already contained a slash
(vendor/model format). This mangled variant tags like :free into /free,
causing 400 Bad Request from the API.

Fix: skip the colon→slash conversion when the model already has a slash,
since the colon is a variant tag, not a vendor separator. The module
docstring already documented this intent (line 17-18) but the
implementation didn't enforce it.

Reported via Discord. Related to PR NousResearch#6088 (which identified the same bug
but placed the fix in model_normalize.py instead of model_switch.py where
the actual mangling occurs).
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
…t) during model switch (NousResearch#6383)

Step c in switch_model() blindly converted the first colon to a slash for
aggregator providers, even when the model name already contained a slash
(vendor/model format). This mangled variant tags like :free into /free,
causing 400 Bad Request from the API.

Fix: skip the colon→slash conversion when the model already has a slash,
since the colon is a variant tag, not a vendor separator. The module
docstring already documented this intent (line 17-18) but the
implementation didn't enforce it.

Reported via Discord. Related to PR NousResearch#6088 (which identified the same bug
but placed the fix in model_normalize.py instead of model_switch.py where
the actual mangling occurs).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant