Repository navigation
fix(no-think): normalize provider prefix to canonical in no-think variants - #4531
Merged
diegosouzapw merged 1 commit intoJun 21, 2026
Conversation
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
…iants When the catalog emits canonical-prefixed model ids (MODELS_CATALOG_PREFIX_MODE=canonical), no-thinking variants built by appendNoThinkingVariants were using the raw alias prefix (e.g. cc/...) instead of the canonical provider name (e.g. claude/...), making the variant ids inconsistent with the rest of the catalog. Changes: - open-sse/utils/noThinkingAlias.ts: add normalizeProviderPrefix() helper and optional aliasToCanonical param to appendNoThinkingVariants(). When the map is provided, the inner provider prefix of each generated no-think id is normalized to its canonical form. - src/app/api/v1/models/catalog.ts: pass aliasToProviderId when prefixMode === 'canonical' so variant ids are canonical-prefix-consistent. - tests/unit/no-thinking-alias.test.ts: 2 new tests covering alias normalization and no-map passthrough. Refs: cheaper-inference#4427
diegosouzapw
force-pushed
the
fix/no-think-canonical-prefix
branch
from
June 21, 2026 18:41
920cfc3 to
6af7b1f
Compare
diegosouzapw
merged commit Jun 21, 2026
9ade3e5
into
cheaper-inference:release/v3.8.33
3 checks passed
Merged
tkgo11
pushed a commit
to tkgo11/OmniRoute
that referenced
this pull request
Sep 23, 2026
…iants (cheaper-inference#4531) Adds pure normalizeProviderPrefix helper + opt-in aliasToCanonical map so no-think variant ids use canonical provider prefixes in canonical catalog mode. Tested. Rebuilt onto release/v3.8.33. Integrated into release/v3.8.33.
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
When
MODELS_CATALOG_PREFIX_MODE=canonical(from #4427), the model catalog emits ids with canonical provider prefixes — e.g.claude/claude-opus-4-5instead ofcc/claude-opus-4-5.However,
appendNoThinkingVariants()was building variant ids from the raw model id without any prefix normalization. This produced inconsistent no-thinking variant ids like:instead of:
Solution
open-sse/utils/noThinkingAlias.ts: add privatenormalizeProviderPrefix()helper and optionalaliasToCanonical?parameter toappendNoThinkingVariants(). When the map is provided, the inner provider prefix of each generated no-think id is normalized to its canonical form before the gateway prefix is applied.src/app/api/v1/models/catalog.ts: passaliasToProviderIdwhenprefixMode === 'canonical'— no-op indual/aliasmodes (undefined → existing behavior).tests/unit/no-thinking-alias.test.ts: 2 new tests covering alias normalization and no-map passthrough (14 total, all passing).Behaviour
alias(default)claude-3-omniroute-no-thinking/cc/claude-opus-4-5(unchanged)dualclaude-3-omniroute-no-thinking/cc/claude-opus-4-5(unchanged)canonicalclaude-3-omniroute-no-thinking/claude/claude-opus-4-5✅Backward-compatible: the new param is optional and defaults to the existing behavior.
Refs: #4427