Skip to content

fix(auto-combo): skip non-chat models in virtual auto candidate pools - #14584

Merged
diegosouzapw merged 2 commits into
cheaper-inference:release/v3.8.51from
VIPKaiser:fix/auto-pool-skip-non-chat-models
Sep 24, 2026
Merged

diegosouzapw merged 2 commits into
cheaper-inference:release/v3.8.51from
VIPKaiser:fix/auto-pool-skip-non-chat-models

Conversation

@VIPKaiser

Copy link
Copy Markdown
Contributor

Problem

prepareVirtualAutoComboInputs() only filters non-chat models for no-auth providers (serviceKinds). For credentialed providers it adds every synced/custom id to the candidate pool regardless of surface. A provider whose /v1/models lists chat and media together — x.ai returns grok-imagine-* next to grok-4.x, local nodes sync Wan2.2/TTS/STT alongside the chat models — therefore scores and dispatches non-chat ids for chat turns. The result is one wasted fallback hop per request and a noisy pool (auto/coding and auto/smart both pick these on this install).

Fix

  • New helper isDeclaredNonChatModel() (open-sse/services/autoCombo/virtualFactory.ts) flags a synced or custom entry whose modelType is non-chat or whose supportedEndpoints name no chat-capable surface (chat / responses). Pool-building drops those ids.
  • x.ai discovery tags grok-imagine-image* as supportedEndpoints: ["images"] and grok-imagine-video* as ["videos"] in providerModelsConfig.ts so they hit the same filter on the next sync.
  • hasUserModels is computed before dropping non-chat ids so an image-only sync does not fall back to the static catalog (regression-tested).

Relationship to open PRs

Tests

  • New tests/unit/auto-pool-skip-non-chat-models.test.ts — predicate behaviour, mixed catalog test (chat/responses kept; images/embed/video dropped), image-only sync keeps the static catalog out, and x.ai tagging covers grok-imagine-image* / grok-imagine-video*.
  • Existing auto-combo, xai, discovery, virtual-auto, candidate-override, and visible-only suites: 663 pass / 2 skipped / 0 fail locally. Typecheck and lint clean for the touched files (with suppressions).

A changelog fragment will follow once the PR number is assigned.

The credentialed branch of prepareVirtualAutoComboInputs() adds every
synced/custom model id to the auto/* candidate pool without looking at
what surface it serves; only no-auth providers are gated (serviceKinds).
Image, video, music and TTS models that a provider lists next to its chat
models (x.ai /v1/models returns grok-imagine-*, local nodes sync Wan/TTS,
suno chirp-*) therefore get scored and dispatched for chat turns and can
only fail, burning a fallback hop each time.

Skip synced/custom models whose modelType is non-chat or whose
supportedEndpoints name no chat-capable surface (chat/responses), and
tag x.ai grok-imagine-* during discovery since /v1/models carries no
type field.
@diegosouzapw

Copy link
Copy Markdown
Collaborator

Verified the fix directly — hasUserModels is correctly computed from the full
userVisibleIds set before the non-chat filter runs, so an image-only sync won't regress
to the static catalog. The DB-backed test covers the mixed-catalog and regression cases
well. Looks merge-ready.

@diegosouzapw
diegosouzapw merged commit ffa1703 into cheaper-inference:release/v3.8.51 Sep 24, 2026
3 checks passed
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