fix(routing): strip provider prefix from model ID when custom base_url is configured (fixes #433)

This commit is contained in:
Nathan Esquenazi
2026-04-14 19:06:35 +00:00
committed by Hermes Agent
parent 85d8aad0ae
commit b3ad60d2c9
2 changed files with 8 additions and 3 deletions

View File

@@ -403,8 +403,10 @@ def test_custom_endpoint_slash_model_routes_to_custom_not_openrouter():
assert base_url == 'http://127.0.0.1:1234/v1', (
"Expected base_url 'http://127.0.0.1:1234/v1', got '{}'.".format(base_url)
)
assert model == 'google/gemma-4-26b-a4b', (
"Model name should be preserved as-is, got '{}'.".format(model)
# Fix #433: provider prefix is now stripped for custom endpoints so stale
# prefixed model IDs from previous sessions do not break custom endpoint routing.
assert model == 'gemma-4-26b-a4b', (
"Model name prefix should be stripped for custom base_url endpoint, got '{}'.".format(model)
)
# --- openrouter with slash model name MUST still route to openrouter -----