fix(models): preserve OpenRouter variant tags (:free, :extended, :fast) during model switch#6383
Merged
Merged
Conversation
…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).
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the bug reported on Discord and identified in PR #6088: OpenRouter model IDs with variant suffixes like
:free,:extended,:fastwere being mangled during/modelswitching.Root cause:
model_switch.pyStep c blindly converted the first colon to a slash for aggregator providers, even when the model already had a slash (meaning it was already invendor/modelformat). Sonvidia/nemotron-3-super-120b-a12b:freebecamenvidia/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 aftermodel_switch.pyhas already mangled the model. The fix needs to be in Step c ofswitch_model()where the mangling actually occurs.Changes
hermes_cli/model_switch.py— addedand "/" not in raw_inputguard to Step ctests/hermes_cli/test_model_switch_variant_tags.py— 7 tests covering :free, :extended, :fast tags, legacy colon format, and bare model namesTest plan