Repository navigation
fix(sse): route claude discovery aliases for catalog-only providers - #9777
Merged
diegosouzapw merged 1 commit intoAug 11, 2026
Conversation
…oviders The /v1/models catalog mirrors `claude/<provider>/<model>` ids purely from the alias gate -- ccAliasPredicate.ts consults no provider registry. The request path additionally required the prefix to be an open-sse REGISTRY entry or an operator-defined custom node. Enterprise-cloud providers such as azure-ai / azure-openai live only in the provider catalog (src/shared/constants/providers/apikey/enterprise-cloud.ts). They route fine directly -- `azure-ai/Phi-4` returns 200 -- but have no open-sse registry entry, so the two sides disagreed: the catalog advertised `claude/azure-ai/<model>` while stripCcDiscoveryAlias refused to strip it. The unstripped id then fell through to normal resolution, which splits on the first / and parsed `claude` as the provider. Every Claude Code request for an Azure model was routed to the Claude provider instead: ROUTING: Provider: claude, Model: azure-ai/DeepSeek-V4-Flash Extract the predicate as `isRoutableProviderPrefix()` and widen it to the provider catalog (id + alias) alongside the open-sse registry, so the request path recognises exactly what the catalog can advertise. Regression guard: tests/unit/cc-discovery-alias-routable-prefix.test.ts pins azure-ai/azure-openai/azure as routable, keeps openai/anthropic routable, and keeps an unknown prefix non-routable. Verified failing before the widening.
Collaborator
|
Thanks for the PR. Please address the mandatory items (tests and/or merge blockers) in this branch, then rerun checks before /merge-prs. |
2 similar comments
Collaborator
|
Thanks for the PR. Please address the mandatory items (tests and/or merge blockers) in this branch, then rerun checks before /merge-prs. |
Collaborator
|
Thanks for the PR. Please address the mandatory items (tests and/or merge blockers) in this branch, then rerun checks before /merge-prs. |
Collaborator
|
Obrigado pelo PR. Mantive a revisão de
|
diegosouzapw
merged commit Aug 11, 2026
4a4cc87
into
cheaper-inference:release/v3.8.50
3 checks passed
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
…oviders (cheaper-inference#9777) The /v1/models catalog mirrors `claude/<provider>/<model>` ids purely from the alias gate -- ccAliasPredicate.ts consults no provider registry. The request path additionally required the prefix to be an open-sse REGISTRY entry or an operator-defined custom node. Enterprise-cloud providers such as azure-ai / azure-openai live only in the provider catalog (src/shared/constants/providers/apikey/enterprise-cloud.ts). They route fine directly -- `azure-ai/Phi-4` returns 200 -- but have no open-sse registry entry, so the two sides disagreed: the catalog advertised `claude/azure-ai/<model>` while stripCcDiscoveryAlias refused to strip it. The unstripped id then fell through to normal resolution, which splits on the first / and parsed `claude` as the provider. Every Claude Code request for an Azure model was routed to the Claude provider instead: ROUTING: Provider: claude, Model: azure-ai/DeepSeek-V4-Flash Extract the predicate as `isRoutableProviderPrefix()` and widen it to the provider catalog (id + alias) alongside the open-sse registry, so the request path recognises exactly what the catalog can advertise. Regression guard: tests/unit/cc-discovery-alias-routable-prefix.test.ts pins azure-ai/azure-openai/azure as routable, keeps openai/anthropic routable, and keeps an unknown prefix non-routable. Verified failing before the widening.
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.
Bug
Claude Code discovery aliases are advertised for providers the request path then refuses to route, so every such request silently goes to the Claude provider instead.
Reproduced live against an Azure AI Foundry connection:
No
CC_DISCOVERYlog line was emitted, confirmingstripped === false.Root cause
The two sides of the alias disagree:
ccAliasPredicate.ts)stripCcDiscoveryAlias)isKnownProviderPrefixisKnownProviderPrefixwas built fromgetRegistryEntry()(theopen-sseREGISTRY) plus operator-defined custom nodes. Enterprise-cloud providers such asazure-ai/azure-openailive only in the provider catalog (src/shared/constants/providers/apikey/enterprise-cloud.ts) and have noopen-sseregistry entry -"azure-ai"appears nowhere underopen-sse/config/.So the catalog advertised the mirror id, the request path declined to strip it, and the unstripped id fell through to normal resolution - which splits on the first
/and parsesclaudeas the provider.This is exactly the hazard called out in
src/lib/ccDiscoveryAliasResolve.ts: "they must match or an alias could be listed yet rejected."Fix
Extract the predicate as
isRoutableProviderPrefix()and widen it to the provider catalog (getProviderById+getProviderByAlias) alongside the existing registry lookup, so the request path recognises exactly what the catalog can advertise.Widening the request side (rather than narrowing the catalog) is the correct direction: these models genuinely route - the direct ids return 200.
Tests
New
tests/unit/cc-discovery-alias-routable-prefix.test.ts:azure-ai,azure-openairoutable (the regression)azurealias resolvesopenai/anthropicstay routableTDD verified - the azure and alias assertions failed against the pre-fix predicate (
false !== true), then passed after the widening.WARNING - base-red inherited: #9737