Skip to content

fix(autoRouting): recognize auto/\<family\> combos in classifyAutoModel - #8866

Merged
diegosouzapw merged 2 commits into
cheaper-inference:release/v3.8.49from
rafaeldrincon:fix/auto-family-classification-in-classifyAutoModel
Jul 28, 2026
Merged

diegosouzapw merged 2 commits into
cheaper-inference:release/v3.8.49from
rafaeldrincon:fix/auto-family-classification-in-classifyAutoModel

Conversation

@rafaeldrincon

Copy link
Copy Markdown
Contributor

Problem

auto/glm, auto/minimax, auto/llama etc. return "Unknown built-in auto combo" at /v1/chat/completions even though they are listed in /api/combos/auto with valid candidate pools.

Root Cause

classifyAutoModel() in src/sse/handlers/autoRouting.ts checks VALID_AUTO_VARIANTS and parseAutoSuffix but never isValidModelFamily. When the suffix is "glm" (not a valid variant, not a category:tier), it sets recognizedBuiltInAuto to the fallback value and createVirtualAutoCombo immediately returns 400.

The family combo logic exists in builtinCatalog.ts (createBuiltinAutoCombo already calls isValidModelFamily) but autoRouting.ts short-circuits before chatHelpers.ts can reach it.

Fix

  • Import isValidModelFamily and ModelFamily from modelFamily.ts
  • Add family?: ModelFamily to AutoRoutingState.spec type
  • Add family suffix check in classifyAutoModel before the fallback return

Tested

All work correctly after fix:

  • auto/glm → routes to GLM model (5 provider candidates)
  • auto/minimax → routes to MiniMax model (4 provider candidates)
  • auto/llama → routes to Llama model (2 provider candidates)
  • Existing auto/coding, auto/best-chat, persisted combos continue working unchanged

classifyAutoModel() checks VALID_AUTO_VARIANTS and parseAutoSuffix but
never isValidModelFamily, so auto/glm, auto/minimax, auto/llama etc. are
rejected as "Unknown built-in auto combo" before chatHelpers.ts or
builtinCatalog.ts can handle them.

Fix: import isValidModelFamily and ModelFamily, add family to spec type,
check family suffixes before returning unrecognized. Mirrors the pattern
already in builtinCatalog.ts createBuiltinAutoCombo.

Closes: auto/\<family\> combos listed in /api/combos/auto but unusable
at /v1/chat/completions.
…gment

The PR changed production code with no test — nothing in tests/ referenced
classifyAutoModel. Since it is module-private, the new suite exercises it through
the public resolveAutoRoutingState().

Verified it guards something real: against the release tip without this fix the
family case fails ("auto/glm should be a recognized built-in auto model"), and
passes with it. Also pins that a category suffix does not pick up spec.family and
that an unknown suffix stays unrecognized.

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
@diegosouzapw
diegosouzapw merged commit bf77648 into cheaper-inference:release/v3.8.49 Jul 28, 2026
3 checks passed
diegosouzapw added a commit that referenced this pull request Jul 28, 2026
…redited)

Second aggregation pass, for the PRs merged after the main reconciliation:
#8860, #8861, #8862, #8863, #8865, #8866.

The `### 📝 Maintenance` heading added to the living section in 26a7783 held —
[3.8.47] stays at its 234 bullets instead of absorbing this cycle's maintenance
entries. Credits attached where the fragment carried the number only in its
filename: @HouMinXi (#8860, #8865), @artickc (#8863), @rafaeldrincon (#8866).
#8862 already carried its own link and credit.

[3.8.49]: 1172 -> 1178 bullets · contributors 155 -> 156 · 42 i18n mirrors synced.
@diegosouzapw diegosouzapw mentioned this pull request Jul 28, 2026
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…el (cheaper-inference#8866)

* fix(autoRouting): recognize auto/\<family\> combos in classifyAutoModel

classifyAutoModel() checks VALID_AUTO_VARIANTS and parseAutoSuffix but
never isValidModelFamily, so auto/glm, auto/minimax, auto/llama etc. are
rejected as "Unknown built-in auto combo" before chatHelpers.ts or
builtinCatalog.ts can handle them.

Fix: import isValidModelFamily and ModelFamily, add family to spec type,
check family suffixes before returning unrecognized. Mirrors the pattern
already in builtinCatalog.ts createBuiltinAutoCombo.

Closes: auto/\<family\> combos listed in /api/combos/auto but unusable
at /v1/chat/completions.

* test(autoRouting): cover auto/<family> classification + changelog fragment

The PR changed production code with no test — nothing in tests/ referenced
classifyAutoModel. Since it is module-private, the new suite exercises it through
the public resolveAutoRoutingState().

Verified it guards something real: against the release tip without this fix the
family case fails ("auto/glm should be a recognized built-in auto model"), and
passes with it. Also pins that a category suffix does not pick up spec.family and
that an unknown suffix stays unrecognized.

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>

---------

Co-authored-by: rafaeldrincon <rafaeldrincon@users.noreply.github.com>
Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…redited)

Second aggregation pass, for the PRs merged after the main reconciliation:
cheaper-inference#8860, cheaper-inference#8861, cheaper-inference#8862, cheaper-inference#8863, cheaper-inference#8865, cheaper-inference#8866.

The `### 📝 Maintenance` heading added to the living section in ae5bf9e held —
[3.8.47] stays at its 234 bullets instead of absorbing this cycle's maintenance
entries. Credits attached where the fragment carried the number only in its
filename: @HouMinXi (cheaper-inference#8860, cheaper-inference#8865), @artickc (cheaper-inference#8863), @rafaeldrincon (cheaper-inference#8866).
cheaper-inference#8862 already carried its own link and credit.

[3.8.49]: 1172 -> 1178 bullets · contributors 155 -> 156 · 42 i18n mirrors synced.
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