Repository navigation
fix(models): strip relay routing prefix before model-listing lookup - #620
Merged
Merged
Conversation
A relay/pool provider takes a model string of the form `name:<sub>/<model-id>`, where the `name:<sub>/` prefix pins WHICH upstream subscription serves the request and only the final segment is the model id the endpoint's /v1/models listing actually contains. validate_requested_model() compared the whole routed string against the listing, so a model that IS listed produced a spurious warning: Warning: Note: could not verify name:claude-apx-0/claude-fable-5 against Claude APR ... The endpoint's model listing does not include it; it may still work if the server supports hidden or aliased models. The model resolved and worked fine — only the verification was wrong — which trains users to ignore a warning that should mean something. Fix: when the requested model carries the `name:.../` routing prefix, look up the bare id after the final `/`, mirroring the existing copilot normalization one branch above. Narrow by construction: gated on the `name:` prefix, so bare model ids and every other provider are untouched. Tests (tests/hermes_cli/test_model_validation.py::TestSubRoutingPrefixStripped): - routed model present in the listing verifies silently (RED before this fix) - routed model ABSENT from the listing still warns (guards against the strip degrading into a blanket accept) - bare model id unaffected 44/44 in the file pass.
This was referenced Sep 26, 2026
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.
Problem
A relay/pool provider takes a model string shaped
name:<sub>/<model-id>— thename:<sub>/prefix pins which upstream subscription serves the request; only the final segment is the model id the endpoint's/v1/modelslisting contains.validate_requested_model()compared the whole routed string against the listing, so a model that is listed produced a false warning:The endpoint does list
claude-fable-5, and the model resolved and ran fine — only the verification was wrong. That is the corrosive kind of bug: it trains users to ignore a warning that should mean something.Fix
When the requested model carries the
name:.../routing prefix, look up the bare id after the final/— mirroring the existingnormalize_copilot_model_idbranch immediately above it. Narrow by construction: gated on thename:prefix, so bare model ids and all other providers are untouched.Tests
tests/hermes_cli/test_model_validation.py::TestSubRoutingPrefixStripped44 passedin the file.