Skip to content

fix(no-think): normalize provider prefix to canonical in no-think variants - #4531

Merged
diegosouzapw merged 1 commit into
cheaper-inference:release/v3.8.33from
Rahulsharma0810:fix/no-think-canonical-prefix
Jun 21, 2026
Merged

diegosouzapw merged 1 commit into
cheaper-inference:release/v3.8.33from
Rahulsharma0810:fix/no-think-canonical-prefix

Conversation

@Rahulsharma0810

Copy link
Copy Markdown
Contributor

Problem

When MODELS_CATALOG_PREFIX_MODE=canonical (from #4427), the model catalog emits ids with canonical provider prefixes — e.g. claude/claude-opus-4-5 instead of cc/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:

claude-3-omniroute-no-thinking/cc/claude-opus-4-5   ← alias prefix (wrong in canonical mode)

instead of:

claude-3-omniroute-no-thinking/claude/claude-opus-4-5   ← canonical prefix (correct)

Solution

  • open-sse/utils/noThinkingAlias.ts: add private normalizeProviderPrefix() helper and optional aliasToCanonical? parameter to appendNoThinkingVariants(). 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: pass aliasToProviderId when prefixMode === 'canonical' — no-op in dual/alias modes (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

prefix mode no-think variant id
alias (default) claude-3-omniroute-no-thinking/cc/claude-opus-4-5 (unchanged)
dual claude-3-omniroute-no-thinking/cc/claude-opus-4-5 (unchanged)
canonical claude-3-omniroute-no-thinking/claude/claude-opus-4-5 ✅

Backward-compatible: the new param is optional and defaults to the existing behavior.

Refs: #4427

@gemini-code-assist

Copy link
Copy Markdown
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
diegosouzapw changed the base branch from main to release/v3.8.33 June 21, 2026 18:41
@diegosouzapw
diegosouzapw force-pushed the fix/no-think-canonical-prefix branch from 920cfc3 to 6af7b1f Compare June 21, 2026 18:41
@diegosouzapw
diegosouzapw merged commit 9ade3e5 into cheaper-inference:release/v3.8.33 Jun 21, 2026
3 checks passed
@diegosouzapw diegosouzapw mentioned this pull request Jun 22, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants