Skip to content

fix(providers): stop rewriting GA qwen3.8-max to preview on opencode-go (#14181) - #14242

Merged
diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.51from
xiechimon:fix/opencode-go-ga-model-alias
Sep 22, 2026
Merged

diegosouzapw merged 1 commit into
diegosouzapw:release/v3.8.51from
xiechimon:fix/opencode-go-ga-model-alias

Conversation

@xiechimon

Copy link
Copy Markdown
Contributor

What

OpenCode Go now serves a GA qwen3.8-max (it shows up as an imported model), but OmniRoute's built-in deprecation table (written when the model shipped only under the -preview id) rewrote it to qwen3.8-max-preview before dispatch. The upstream rejects the preview id with 401 Model qwen3.8-max-preview is not supported.

The provider-aware exemption in resolveModelAlias (#11503) never fired here: the opencode-go static registry didn't declare the GA id, so hasKnownProviderModel("opencode-go", "qwen3.8-max") returned false and the global rewrite applied.

Changes

The built-in rewrite stays for providers that only serve the preview id (qoder, bailian-coding-plan, qwen-cloud-token-plan) and for callers with no provider in hand.

Verification

  • New test tests/unit/14181-opencode-go-qwen-ga-alias.test.ts, 4 cases: the registry declares the GA id with the qwen family flags; resolveModelAlias("qwen3.8-max", "opencode-go") returns the id unchanged; preview-only providers (qoder) and no-provider callers still resolve to the preview id; the GA id resolves to its own spec row.
  • Red-green checked against base: with the src changes reverted and only the test kept, 3 of 4 cases fail (the qoder control passes); with the fix, 4/4 pass.
  • Adjacent suites: alias/deprecation/registry tests 29/29, qwen and model-specs area tests 77/77.
  • prettier --check, eslint, typecheck:core clean on all touched files.

Fixes #14181

…go (diegosouzapw#14181)

OpenCode Go now serves a GA qwen3.8-max, but the built-in deprecation
table (written when the model shipped only under the -preview id)
rewrote it to qwen3.8-max-preview before dispatch, and the upstream
rejects the preview id with a 401. The provider-aware exemption in
resolveModelAlias never fired because the opencode-go static registry
lacked the GA id.

- declare qwen3.8-max in the opencode-go registry (qwen family there is
  text-only and routes through the Claude translator per diegosouzapw#2292)
- give the GA model its own MODEL_SPECS row instead of aliasing it to
  the preview spec

The rewrite stays for preview-only providers (qoder, bailian-coding-plan,
qwen-cloud-token-plan) and for callers with no provider in hand.
Copilot AI lite review requested due to automatic review settings September 20, 2026 05:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@diegosouzapw

Copy link
Copy Markdown
Owner

Thanks @xiechimon — merging via the release merge-train. Validated in local merge-train (mt-train10c) on the devbox @ train tip 4d841aa1c740bbaa03868dc0a403c62099a99a42 with the 72 sibling PRs of this batch: typecheck:core, file-size, complexity, cognitive-complexity, changelog-integrity green; changed-area node:test 831/831 (0 failing) and vitest 480/482 — the two reds are autoCombo/provider-family-combos.test.ts timing out at 20s, which reproduces on the PURE release tip under the full vitest suite (and is already tracked by the Release-Green issue #13866), so it is inherited, not this batch's. Merged --admin per merge-gates §3/§4/§7.

@diegosouzapw
diegosouzapw merged commit 83a6e9a into diegosouzapw:release/v3.8.51 Sep 22, 2026
7 of 16 checks passed
diegosouzapw added a commit that referenced this pull request Sep 22, 2026
`qwen38-max-bare-id-alias.test.ts` asserted `MODEL_SPECS["qwen3.8-max"] ===
undefined`, guarding against a second source of truth for what was then the SAME
model published under two ids (the preview row carried `aliases:
["qwen3.8-max"]`).

That premise expired in #14181/#14242 (83a6e9a, "stop rewriting GA qwen3.8-max to
preview on opencode-go"): OpenCode Go ships a GA `qwen3.8-max` that answers 401 on
the `-preview` id, so the two ids are now two DISTINCT models and the commit
deliberately gave the GA one its own MODEL_SPECS row while dropping the alias from
the preview row. The production change is correct; the assertion is the stale side.

Replaced it with the invariant this file actually exists to protect — NEITHER id may
fall through to contextManager's `default: 128000` — plus a guard that the preview
row does not re-declare the bare id as an alias, which is what would silently
collapse the two rows back into one. No assertion was removed or weakened.

ℹ pass 5 / ℹ fail 0 (node --import tsx/esm --test)
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.

fix(opencode-go): stop rewriting qwen3.8-max to preview

3 participants