Skip to content

test(models): pin qwen3.8-max resolution per provider, not across all four - #11590

Merged
diegosouzapw merged 2 commits into
cheaper-inference:release/v3.8.51from
ntdatt812:fix/qwen38-provider-aware-alias
Aug 26, 2026
Merged

diegosouzapw merged 2 commits into
cheaper-inference:release/v3.8.51from
ntdatt812:fix/qwen38-provider-aware-alias

Conversation

@ntdatt812

Copy link
Copy Markdown
Contributor

Part of the "every gate is red on every branch" cleanup — one of six independent unit-test failures on release/v3.8.51.

The red test

✖ chatCore lifecycle resolution rewrites the model before dispatch
  AssertionError: resolvedModel for qwen-cloud-token-plan
  actual: 'qwen3.8-max', expected: 'qwen3.8-max-preview'

The test's premise expired halfway

Its docblock states the model "ships everywhere as qwen3.8-max-preview
(bailian-coding-plan, qoder, qwen-cloud-token-plan, qwen-web)". Probed against the live
catalogs and hasKnownProviderModel:

provider catalog ids matching qwen3.8-max serves the bare id? resolveModelAlias(bare, provider)
qwen-cloud-token-plan ["qwen3.8-max"] true qwen3.8-max
qwen-web ["qwen3.8-max"] true qwen3.8-max
qoder ["qwen3.8-max-preview"] false qwen3.8-max-preview
bailian-coding-plan ["qwen3.8-max-preview"] false qwen3.8-max-preview

Two of the four now list the bare id and no longer carry -preview at all.

The code is right

resolveModelAlias short-circuits the built-in alias when the provider serves the id
itself:

// The provider serves this id itself — nothing is deprecated from its point of view.
if (provider && hasKnownProviderModel(provider, modelId)) return modelId;

Rewriting qwen3.8-max → -preview on those two would dispatch an id they no longer
serve — the mirror image of the 404 the original fix prevented. That short-circuit is
also why the BUILT_IN_ALIASES entry correctly stays rather than being dropped: the
other two still need it, and the alias map's own comment anticipated exactly this split
("Drop this line if Alibaba ever ships a distinct GA qwen3.8-max").

What changed

The loop asserted one outcome for all four providers, which the split made impossible to
express. It now asserts both directions, and adds a case pinning the catalog premise
itself:

const SERVES_BARE    = ["qwen-cloud-token-plan", "qwen-web"];
const SERVES_PREVIEW = ["qoder", "bailian-coding-plan"];

So if a catalog flips again, the premise case fails first and names the provider that
moved, instead of leaving the lifecycle assertions failing with no explanation. The
docblock records the half-expiry rather than pretending the original premise still holds.

Verification

# base branch
✖ chatCore lifecycle resolution rewrites the model before dispatch
ℹ tests 4  ℹ pass 3  ℹ fail 1

# with this change
✔ bare qwen3.8-max resolves to the canonical -preview id
✔ the canonical id is a no-op through the alias map (no double rewrite)
✔ the alias target carries the real 1M window, not the 128k fallback
✔ the catalog split the two ids across providers
✔ chatCore lifecycle rewrites the model only where the provider needs it
ℹ tests 5  ℹ pass 5  ℹ fail 0

Test-only; no production code touched.

… four

`Unit Tests fast-path` is red on every branch:

    ✖ chatCore lifecycle resolution rewrites the model before dispatch
      resolvedModel for qwen-cloud-token-plan
      actual: 'qwen3.8-max', expected: 'qwen3.8-max-preview'

The test's premise — "the model ships everywhere as `qwen3.8-max-preview`
(bailian-coding-plan, qoder, qwen-cloud-token-plan, qwen-web)" — has half expired.
Probed against the live catalogs:

    qwen-cloud-token-plan  -> ["qwen3.8-max"]           hasKnownProviderModel(bare) = true
    qwen-web               -> ["qwen3.8-max"]           hasKnownProviderModel(bare) = true
    qoder                  -> ["qwen3.8-max-preview"]   hasKnownProviderModel(bare) = false
    bailian-coding-plan    -> ["qwen3.8-max-preview"]   hasKnownProviderModel(bare) = false

Two of the four now list the BARE id and no longer carry `-preview` at all.
`resolveModelAlias`'s `hasKnownProviderModel` short-circuit is what stops the built-in
alias firing there — rewriting would dispatch an id those two no longer serve — which is
also why the alias entry stays for the other two rather than being dropped.

The loop asserted one outcome for all four. It now asserts both, split by which id the
provider serves, plus a case pinning the catalog premise itself so a future flip fails
with "which provider moved" instead of leaving the lifecycle assertions unexplained.
@diegosouzapw
diegosouzapw merged commit 954d58b into cheaper-inference:release/v3.8.51 Aug 26, 2026
10 of 16 checks passed
diegosouzapw pushed a commit that referenced this pull request Aug 26, 2026
Merged via /merge-batch (lote 2026-08-26 batch 2, v3.8.51). 7 conflitos, todos triviais/duplicados (mesmos base-reds já corrigidos por PRs paralelas mergeadas neste lote — #11580/#11582/#11583/#11585/#11588/#11589/#11590/#11591/#11609): mantida a versão já validada nesses casos. Validado: 68/68 testes passando. Obrigado por resolver os base-reds.
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
… four (cheaper-inference#11590)

Merged via /merge-batch (lote 2026-08-26, v3.8.51). Boarded no worktree combinado junto com outras ~30 PRs; validação única: typecheck/complexity/cognitive-complexity/changelog-integrity verdes, file-size rebaseado onde necessário (crescimento legítimo), lint com os mesmos 228 achados pré-existentes confirmados via sonda contra o tip puro (não introduzidos por este lote), e ~370 testes focados (unit + vitest) passando. Obrigado pela contribuição.
muhamadgalihsaputra pushed a commit to niyatna/NiyatnaRoute that referenced this pull request Sep 27, 2026
…per-inference#11608)

Merged via /merge-batch (lote 2026-08-26 batch 2, v3.8.51). 7 conflitos, todos triviais/duplicados (mesmos base-reds já corrigidos por PRs paralelas mergeadas neste lote — cheaper-inference#11580/cheaper-inference#11582/cheaper-inference#11583/cheaper-inference#11585/cheaper-inference#11588/cheaper-inference#11589/cheaper-inference#11590/cheaper-inference#11591/cheaper-inference#11609): mantida a versão já validada nesses casos. Validado: 68/68 testes passando. Obrigado por resolver os base-reds.
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