Skip to content

fix(core): add modality metadata for qwen3.8-flash and qwen3.8-plus - #10195

Merged
yiliang114 merged 4 commits into
QwenLM:mainfrom
yiliang114:issue-10194
Aug 27, 2026
Merged

fix(core): add modality metadata for qwen3.8-flash and qwen3.8-plus#10195
yiliang114 merged 4 commits into
QwenLM:mainfrom
yiliang114:issue-10194

Conversation

@yiliang114

@yiliang114 yiliang114 commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

Add qwen3.8-flash and qwen3.8-plus to MODALITY_PATTERNS with { image: true, video: true }.

Problem

qwen3.8-flash was classified as text-only by defaultModalities() because MODALITY_PATTERNS only had an entry for qwen3.8-max. This caused read_file on images to silently route through the vision bridge (a second, separately billed model call) instead of native inline attachment.

Fixes #10194

Changes

  • packages/core/src/core/modalityDefaults.ts: Add qwen3.8-flash and qwen3.8-plus entries before the qwen3.8-max entry in MODALITY_PATTERNS
  • packages/core/src/core/modalityDefaults.test.ts: Add regression tests for qwen3.8-flash and qwen3.8-plus

Verification

  • 52/52 tests pass in modalityDefaults.test.ts (including 2 new regression tests)

qwen3.8-flash and qwen3.8-plus were classified as text-only by
defaultModalities() because MODALITY_PATTERNS only had qwen3.8-max.
This caused read_file on images to route through the vision bridge
(secondary model call) instead of native inline attachment.

Also adds modalities metadata to the alibabaStandard preset for
qwen3.6-plus and qwen3.7-plus, matching the token-plan preset.

Fixes QwenLM#10194

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
@qwen-code-ci-bot

qwen-code-ci-bot commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Qwen Triage finishedview run. See the stage comments in this thread for the result.

Qwen Triage 已完成 —— 查看运行。结果见本线程中的各阶段评论。

@qwen-code-ci-bot qwen-code-ci-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the PR, @yiliang114! The underlying problem is well established — #10194 carries authoritative catalog evidence and a before/after reproduction, and the root cause still holds on main (qwen3.8-flash/qwen3.8-plus fall through to the text-only catch-all, and the alibabaStandard preset has no modalities metadata). Before we can review the change itself, though, the PR description needs to follow the repository's pull request template.

The current body uses free-form headings (Summary, Problem, Changes, Verification), but none of the template's required sections are present:

  • ## What this PR does
  • ## Why it's needed
  • ## Reviewer Test Plan (with ### How to verify, ### Evidence (Before & After), and the ### Tested on OS table)
  • ## Risk & Scope
  • ## Linked Issues
  • the bilingual <details> Chinese summary the template asks for

Please edit the PR body to follow the template: https://github.com/QwenLM/qwen-code/blob/main/.github/pull_request_template.md

The substance you've already written maps cleanly onto those sections — the linked issue already carries the reproduction and before/after evidence — so this is a reformat, not new work. Once the body follows the template, re-trigger triage (@qwen-code /triage) and we'll continue with the review.

中文说明

感谢提交 PR,@yiliang114!问题本身已经很扎实——#10194 提供了官方能力目录证据和 before/after 复现,并且根因在 main 上依然存在(qwen3.8-flash/qwen3.8-plus 落入 text-only 兜底规则,alibabaStandard preset 也完全没有 modalities 元数据)。不过在进入代码审查之前,PR 描述需要先按照仓库的 pull request 模板来填写。

当前正文使用的是自由格式的小节(SummaryProblemChangesVerification),模板要求的小节一个都没有:

  • ## What this PR does
  • ## Why it's needed
  • ## Reviewer Test Plan(包含 ### How to verify### Evidence (Before & After) 以及 ### Tested on 操作系统表格)
  • ## Risk & Scope
  • ## Linked Issues
  • 模板要求的双语 <details> 中文说明

请按照模板编辑 PR 正文:https://github.com/QwenLM/qwen-code/blob/main/.github/pull_request_template.md

你已经写好的内容可以很自然地对应到这些小节——关联 issue 里已经有完整的复现和 before/after 证据——所以这只是重新排版,不需要新增内容。正文符合模板后,重新触发 triage(@qwen-code /triage),我们会继续审查。

Qwen Code · qwen3.8-max

@qwen-code-ci-bot qwen-code-ci-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed. Suggestions are inline.

— qwen3.8-max via Qwen Code /review (v0.22.2)

Comment thread packages/core/src/providers/presets/alibaba-standard.ts Outdated
Comment thread packages/core/src/core/modalityDefaults.test.ts Outdated
…ties tests

Address two CI bot suggestions on PR QwenLM#10195:

1. alibaba-standard.test.ts: assert modalities inside generationConfig
   so removing the field from the provider config would fail the test.

2. modalityDefaults.test.ts: use toEqual({image:true,video:true})
   instead of individual toBe(true) checks, pinning the exact shape
   and catching accidental extra modality keys.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
@yiliang114

Copy link
Copy Markdown
Collaborator Author

@qwen-code /triage

@qwen-code-ci-bot

qwen-code-ci-bot commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Sandboxed verification: ✅ passed — merge-ready (agent verdict) - workflow run

Ran the PR in an isolated, token-free container: A/B against the base build, mock-free harness assertions, targeted gates. Advisory evidence for human reviewers — not a review, an approval, or a CI check.

Scripted assertions: 52 passed · 0 failed · 52 total

Flakiness gate: ✅ 2 changed test file(s) x 5 identical rounds, no divergence

中文 — 判定:✅ 通过 · 可合入(agent 判定)

沙箱验证在隔离、无凭证的容器中执行了该 PR 的代码(与 base 构建 A/B 对照、无 mock harness 断言、定向门禁)。仅作为评审证据,不构成评审、批准或 CI 检查

脚本断言:52 通过 · 0 失败 · 52 总计

抖动门:✅ 2 changed test file(s) x 5 identical rounds, no divergence

Verification report

PR #10195 Deep Verification — fix(core): add modality metadata for qwen3.8-flash and qwen3.8-plus

Verdict: merge-ready — 52/52 scripted assertions passed (43 A/B harness + 9 log-verified mutation/gate checks), 0 unexpected failures.
Verified head: 16ad5b8d993c7dc4774a4ca2fedb0b4a2e8d7841 (git rev-parse HEAD^2, matches the metadata snapshot — no drift). Base tip: a82a11a0a4d8d4f97796ac9f56d276364dd3bd64.

中文摘要

结论:merge-ready。52/52 脚本化断言全部通过,无意外失败。

  • A/B 结论:核心变更负载成立。对 base tip(a82a11a0)与 PR head 分别编译 modalityDefaults.ts 单文件 bundle(两者经 diff 证明仅差 PR 那一个 hunk),驱动 15 个模型 ID 单元格:qwen3.8-flash / qwen3.8-plus(含 preview/日期后缀/大写/provider/ 前缀/authType: 前缀等 6 个兄弟形状)在 base 上全部返回 {}(纯文本分类),在 head 上全部翻转为 {image:true, video:true};所有未改动模型(qwen3.8-maxqwen3.7-plus、未知模型等)两臂完全一致。视觉桥路由判据 isImageCapable 随之由 false 翻转为 true(见下表与 01-ab-modality-cells.png)。
  • preset 变更:alibabaStandard 的 install plan 在 head 上正确持久化 generationConfig.modalities(base 上缺失),custom-model 不受影响。但探测表明该 hunk 属冗余防御:qwen3.6-plus/qwen3.7-plus 的名称 pattern 在 base 上已存在,所有读取点都有名称回退,两臂运行时值相同(详见"更正")。
  • 测试非空泛:5 个变异体全部被杀——还原任一新代码行恰好使对应新测试以预期断言失败;两个阳性对照落在同一文件;toEqual 精确形状变体(多加 audio 键)也被杀,证实第二个 commit 的加固定型有效。
  • Findings:无代码缺陷。仅一处对 PR 描述的更正(见下节)。
  • 未覆盖:逐 commit 归因(浅克隆仅达 tip)、模型真实能力的外部事实核验(沙箱无网络)、完整 read_file→真实模型调用的端到端路由(复现的是决策公式一层,非全链路)、typecheck/lint(由 CI 覆盖)。

Scope

  • Central claim: defaultModalities() classifies qwen3.8-flash / qwen3.8-plus as {image:true, video:true} instead of text-only, flipping image routing from the vision bridge to native inline attachment (fixes qwen3.8-flash is treated as text-only; alibabaStandard preset carries no modality metadata #10194).
  • Secondary claim 1: the alibabaStandard preset persists modalities for qwen3.6-plus / qwen3.7-plus into install plans.
  • Secondary claim 2: the new/changed tests are non-vacuous and pin the exact shape.

Central claim — A/B load-bearing proof

Control construction: modalityDefaults.ts (which imports only the dependency-free normalize() from tokenLimits.ts) was esbuild-bundled separately from the head tree and from a scratch worktree at the base tip. A diff of the two bundles shows they differ by exactly the PR hunk — two added pattern lines and the comment (logs/control-bundle-diff.log, re-asserted by the summary harness). No workspace links are crossed: the module has no @qwen-code/* imports.

Cell Oracle Base tip PR head
defaultModalities('qwen3.8-flash') return value {} (text-only) {image:true, video:true}
defaultModalities('qwen3.8-plus') return value {} {image:true, video:true}
siblings: -preview, dated -2026-08-01, -latest, QWEN3.8-FLASH, dashscope/…, qwen-oauth:… (6 cells) return value {} ×6 {image,video} ×6
qwen3.8-max / qwen3.8-max-preview (controls) return value {image:true} {image:true} (unchanged)
qwen3.7-plus, qwen3.6-plus, qwen3.6-flash, qwen3-coder-plus, unknown (controls) return value identical identical
isImageCapable({id:'qwen3.8-flash'}) — vision-bridge-service.ts:62 expression bool false true
isImageCapable({id:'qwen3.8-plus'}) bool false true

15 model IDs × 2 arms = 30 cell assertions, all as predicted (expected base reds encoded as expectations, so all count as passes). Witness: evidence/01-ab-modality-cells.png (raw cells as printed, logs/ab-harness.log).

Downstream chain verified by reading: defaultModalities() fills generationConfig.modalities in modelRegistry.resolveModelConfig (line 321), modelsConfig (441, 937) and modelConfigResolver (430); isImageCapable (vision-bridge-service.ts:62) and fileUtils.ts:1224 (read_file PDF/image handling) consume the result. qwen3.8-flash/qwen3.8-plus appear in no provider preset (grepped packages/core/src/providers), so defaultModalities() is the sole source for these IDs — the change is load-bearing for every setup path.

Secondary claim 1 — preset → install plan (both arms)

Cell Base tip PR head
buildInstallPlan(alibabaStandard, …['qwen3.6-plus','qwen3.7-plus','custom-model'])generationConfig['qwen3.6-plus'] {extra_body, contextWindowSize}no modalities adds modalities:{image,video}
same for qwen3.7-plus no modalities adds modalities:{image,video}
generationConfig['custom-model'] undefined undefined (unchanged)
getDefaultModelIds(alibabaStandard) identical identical

Same table, same witness (01-ab-modality-cells.png, sections C–D).

Corrections

Correction to the PR description (not a code-change request): the body states the alibabaStandard preset "lacked modalities metadata entirely, so Standard API-key users had no path to correct capability data." Tracing every read site shows this overstates the effect: the name patterns /^qwen3\.6-plus/ and /^qwen3\.7-plus/ already existed at base (they are context lines in the diff), and every consumer of modalities falls back to defaultModalities() when the persisted field is absent (vision-bridge-service.ts:62, modelRegistry.ts:321, modelsConfig.ts:441/937, modelConfigResolver.ts:430, via contentGeneratorConfig into fileUtils.ts:1224 and the generators). Section D of the A/B harness measured this directly: runtime modalities for a Standard-installed qwen3.6-plus are {image,video} on both arms. The preset hunk is therefore redundant defence / self-describing data (consistent with the token-plan preset), not a behavioural routing fix. It is harmless, and the strengthened test pins it — no action needed, but the motivation as written is inaccurate.

Findings

None. No code defect was produced by the evidence.

Mutation matrix (vacuity)

Each mutant was applied to a backup-guarded copy of the real source, the target suite run, and the file restored (git status clean after each). Every row is log-verified by summary-harness.mjs (logs/mutant-M*.log); witness evidence/02-mutation-matrix.png.

# Mutation Expected catcher Result
M1 revert pattern hunk → base state the 2 new regression tests KILLED2 failed | 50 passed (52), both fail on expected {} to deeply equal { image: true, video: true } (behavioural mismatch, not setup breakage)
M2 qwen3.8-max{} (positive control, same file) existing max tests KILLED — 2 existing tests fail, proving the vitest invocation collects this file
M3 revert preset modalities → base state install-plan test (commit 2) KILLED1 failed | 7 passed (8), failure diff names the missing modalities block
M4 drop enableThinking on deepseek-v4-pro (positive control, same file) DeepSeek test KILLED — a different existing test fails
M5 add extra audio:true to flash entry toEqual exact-shape (commit 2's claim) KILLED — diff cites + "audio": true; old-style toBe(true) checks would have survived this

No survivors. The positive controls landed in the same files as their mutants, so the kills are attributable to the suites, not to a harness accident.

Targeted gates (head, unmutated)

Gate Scope Result
G1 modalityDefaults.test.ts + alibaba-standard.test.ts 60/60 (52 + 8 — matches the PR's claimed 52/52)
G2 entire src/providers/ dir (blast radius) 172/172, 16 files
G3 consumer suites: modelConfigResolver.test.ts, src/services/visionBridge/, dashscope.test.ts 312/312, 5 files

Zero failures at head, so no base-side failure attribution was needed.

Not covered

  • Per-commit attribution — the depth-2 checkout reaches only the merge commit, base tip, and PR head tip (git rev-list HEAD^1..HEAD^2 returns 1 commit vs the snapshot's 2). The aggregate HEAD^1..HEAD diff is what was verified; commit 2's claims were nevertheless exercised individually (M3, M5 target exactly its changes).
  • External capability facts — whether qwen3.8-flash/qwen3.8-plus truly accept image+video input on the DashScope API is model-metadata asserted by the author; the sandbox has no network or credentials to verify it against the vendor. Same for the pre-existing asymmetry that qwen3.8-max is image-only in MODALITY_PATTERNS but {image,video} in the token-plan preset — pre-existing at base, untouched by this PR.
  • Sibling model qwen3.6-flash (listed in token-plan with no modalities; name table classifies it text-only) — same bug class, pre-existing, unchanged by this PR; whether it is actually multimodal is external data.
  • Full end-to-end read_file routing with a real image and a real model call — no credentials in the sandbox. The A/B reproduces the routing decision (the exact isImageCapable expression and the modalities-fill chain), i.e. the shape of the mechanism, not the wire-level cause on a live API.
  • Typecheck / lint / format — covered by the PR's own CI; not re-run here (vitest transformed all changed TS cleanly during the gates).

Methodology

Environment: CI verify container (node:22-bookworm, node v22.23.2), merge-ref checkout at depth 2 (HEAD = merge 2c1e6765fd, HEAD^1 = base tip, HEAD^2 = PR head), npm ci + npm run build pre-run. A/B control: scratch worktree at a82a11a0 under tmp/base-tree; the four code units under test (modalityDefaults.ts ×2 arms, provider-config.ts + alibaba-standard.ts ×2 arms) were esbuild-bundled per arm from source, so no workspace symlink could leak head code into the base arm — the only shared dependency resolution was third-party (packages/core/node_modules symlinked into the base tree for the OpenTelemetry/ajv nested install; verified it contains zero @qwen-code/* entries, and the PR touches no package.json/lockfile). Control purity proven by diffing the two modality bundles (differ by exactly the PR hunk; logs/control-bundle-diff.log). Harnesses (ab-harness.mjs, summary-harness.mjs) encode every expectation — predicted base failures count as passes; fail counts only unexpected outcomes. Mutation round edited real source files with prior backups and restored after each run (worktree verified clean). Raw per-run logs live in logs/; builds in builds/.

Flakiness gate log

rounds=5 files=2 skipped=0
file packages/core/src/core/modalityDefaults.test.ts: (cd packages/core) npx --no-install vitest run ./src/core/modalityDefaults.test.ts
file packages/core/src/providers/__tests__/presets/alibaba-standard.test.ts: (cd packages/core) npx --no-install vitest run ./src/providers/__tests__/presets/alibaba-standard.test.ts


per-file results (P=pass F=fail I=infra-exit, one letter per run):
  packages/core/src/core/modalityDefaults.test.ts: PPPPP
  packages/core/src/providers/__tests__/presets/alibaba-standard.test.ts: PPPPP

verdict: pass
summary: 2 changed test file(s) x 5 identical rounds, no divergence

--- per-invocation detail (full copy in the artifact) ---
round 1 · packages/core/src/core/modalityDefaults.test.ts: P (exit 0)
round 1 · packages/core/src/providers/__tests__/presets/alibaba-standard.test.ts: P (exit 0)
round 2 · packages/core/src/core/modalityDefaults.test.ts: P (exit 0)
round 2 · packages/core/src/providers/__tests__/presets/alibaba-standard.test.ts: P (exit 0)
round 3 · packages/core/src/core/modalityDefaults.test.ts: P (exit 0)
round 3 · packages/core/src/providers/__tests__/presets/alibaba-standard.test.ts: P (exit 0)
round 4 · packages/core/src/core/modalityDefaults.test.ts: P (exit 0)
round 4 · packages/core/src/providers/__tests__/presets/alibaba-standard.test.ts: P (exit 0)
round 5 · packages/core/src/core/modalityDefaults.test.ts: P (exit 0)
round 5 · packages/core/src/providers/__tests__/presets/alibaba-standard.test.ts: P (exit 0)

Evidence images

01-ab-modality-cells

02-mutation-matrix

Harness scripts and raw logs are in the workflow run artifacts (7-day retention).

Qwen Code · sandboxed verification

@qwen-code-ci-bot

Copy link
Copy Markdown
Collaborator

Thanks for the PR, and for addressing both /review suggestions on the new push!

Template: the body is still free-form — the previous pass stopped at this exact gate. Since the author is a maintainer of this repo and re-triggered triage with all the substance in place (what/why/verification in the body, full reproduction in the linked issue), I'm not gating on heading formatting a second time and will proceed. Flagging it so this is a visible, deliberate call rather than a silent skip.

Problem: real and well evidenced. #10194 carries authoritative catalog output (qianwen models info qwen3.8-flash → input image/text/video), a before/after reproduction, and root-cause analysis. I confirmed the root cause still holds on main: MODALITY_PATTERNS has no qwen3.8-flash/qwen3.8-plus entry (both fall through to the text-only /^qwen/ catch-all), and the alibabaStandard preset carries no modalities metadata at all.

Direction: aligned. This is the same reactive catch-up the modality table has always done (per the issue's own history), and it fixes a silent quality + extra-billing regression for Standard API-key users.

Size: core paths touched (core/modalityDefaults.ts, providers/presets/alibaba-standard.ts) — 18 production lines (4 + 14), 16 test lines, 0 generated. The author is a maintainer, so the two-tier core gate is exempt regardless; the change is data-only.

Approach: minimal — exactly the issue's suggested fixes 1 and 2, with the larger items (catalog-derived modalities, pinned user config, supportsModelDiscovery) correctly left out. New patterns sit before qwen3.8-max and the catch-all, so matching order is sound.

Risk: no elevated risk signals (no high-risk path matches).

Moving on to code review. 🔍

中文说明

感谢提交 PR,也感谢在新提交里处理了两条 /review 建议!

模板:正文仍是自由格式——上一轮 triage 正是停在这一步。鉴于作者是仓库维护者,且重新触发 triage 时实质内容都已齐备(正文说明了做什么/为什么/如何验证,关联 issue 里有完整复现),不再第二次因标题格式拦截,直接进入审查。此处显式标注这一决定,而非悄悄跳过。

问题:真实存在且证据充分。#10194 提供了官方能力目录输出(qianwen models info qwen3.8-flash → 输入 image/text/video)、before/after 复现和根因分析。已在 main 上确认根因依然成立:MODALITY_PATTERNS 没有 qwen3.8-flash/qwen3.8-plus 条目(两者落入 text-only 的 /^qwen/ 兜底),alibabaStandard preset 也完全没有 modalities 元数据。

方向:对齐。这与 modality 表一直以来的追赶式更新一致(见 issue 中的梳理),修复的是 Standard API-key 用户被静默降级(画质损失 + 额外计费)的问题。

规模:触及核心路径(core/modalityDefaults.tsproviders/presets/alibaba-standard.ts)——18 行生产代码(4 + 14)、16 行测试、0 行生成代码。作者是维护者,两层核心门禁本就豁免;改动本身也只是数据。

方案:最小化——正是 issue 建议的修复 1、2 两项,更大的议题(从目录派生 modality、固定用户配置、supportsModelDiscovery)正确地没有夹带。新规则放在 qwen3.8-max 和兜底规则之前,匹配顺序正确。

风险:无升级风险信号(未命中高风险路径)。

进入代码审查 🔍

Qwen Code · qwen3.8-max

Reviewed at 16ad5b8d993c7dc4774a4ca2fedb0b4a2e8d7841 · re-run with @qwen-code /triage

@qwen-code-ci-bot

qwen-code-ci-bot commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Code review

Independent proposal first: for this problem I'd have done exactly what this PR does — two MODALITY_PATTERNS entries ahead of the qwen3.8-max line and the /^qwen/ catch-all, plus modalities metadata on the two alibabaStandard preset entries the regex table already knows to be multimodal. The PR matches that; I found no simpler path.

Details I verified while reading the diff:

  • Pattern order is safe: ^qwen3\.8-flash / ^qwen3\.8-plus can't be shadowed by the earlier 3.5/3.6/3.7-plus entries, and they land before qwen3.8-max (image-only, unchanged) and the text-only catch-all.
  • qwen3.8-flash gets { image: true, video: true } matching the catalog evidence in qwen3.8-flash is treated as text-only; alibabaStandard preset carries no modality metadata #10194; qwen3.8-max stays image-only — no capability claim drift in either direction.
  • The preset change follows the established sibling pattern (alibaba-token-plan, alibaba-coding-plan) and flows through buildGenerationConfig() into generationConfig.modalities, which the runtime reads ahead of the name fallback (model.modalities ?? defaultModalities(model.id) in isImageCapable).
  • Both /review suggestions from the previous round are addressed on this head: the new modality tests use exact-shape toEqual({ image: true, video: true }), and the install-plan test pins the preset modalities field.

No blockers, no convention violations.

Test evidence — this PR's own CI

Every vitest suite in the ubuntu job passed, including both touched files — src/core/modalityDefaults.test.ts ✓ (52 tests) and src/providers/__tests__/presets/alibaba-standard.test.ts ✓ (8 tests). The job is nonetheless red, and the failure is not this PR's: it is the test-efficacy harness's positive control ("the injected always-failing test did not turn the run red"), with every probe hitting fatal: '<scratch>/wt-probe' is not a working tree. The harness injects its own fixture test into scratch worktrees, so PR code has no plausible causal path; the previous /review round's mutant run on the earlier head hit the same class of environment failures. Classifying as CI infra noise — a maintainer re-run of the job should confirm.

Final CI results for 16ad5b8 (auto-updated by the triage finalize job after CI completed):

Check Conclusion
Test (ubuntu-latest, Node 22.x) ❌ failure
Classify PR ✅ success
Dependency CVE audit ✅ success
Desktop Shell (ubuntu-22.04) ✅ success
Desktop Shell (windows-2022) ✅ success
Secret scan (TruffleHog) ✅ success
web-shell E2E Smoke (ubuntu-latest, Node 22.x) ✅ success

One row per check name (latest run); skipped checks omitted; failures sort first. / 每个检查名一行(取最新一次运行),省略 skipped,失败项排在最前。

Not verified: the end-to-end behavior — that read_file on an image with qwen3.8-flash selected now attaches pixels natively instead of routing through the vision bridge. CI pins the classification and the preset metadata, but not the live attachment path. Sandboxed verification would settle this: @qwen-code /verify — an A/B run against the base build would show the bridge path disappearing for the two newly classified models. (The author holds write access, so @qwen-code /tmux is also available if a TUI walkthrough is preferred.)

中文说明

代码审查

先说独立方案:换作我来修,做法与本 PR 完全一致——在 qwen3.8-max 条目和 /^qwen/ 兜底之前加两条 MODALITY_PATTERNS,并给 alibabaStandard preset 中 regex 表已知为多模态的两个条目补上 modalities。PR 与独立方案一致,没有找到更简路径。

读 diff 时逐项确认:

  • 模式顺序安全:^qwen3\.8-flash / ^qwen3\.8-plus 不会被前面的 3.5/3.6/3.7-plus 条目遮蔽,且位于 qwen3.8-max(仅 image,未改动)和 text-only 兜底之前。
  • qwen3.8-flash{ image: true, video: true },与 qwen3.8-flash is treated as text-only; alibabaStandard preset carries no modality metadata #10194 的目录证据一致;qwen3.8-max 保持仅 image——两个方向都没有能力声明的漂移。
  • preset 改动沿用了兄弟 preset(alibaba-token-planalibaba-coding-plan)的既有模式,经 buildGenerationConfig() 流入 generationConfig.modalities,运行时优先读取它、其次才是名称回退(isImageCapable 中的 model.modalities ?? defaultModalities(model.id))。
  • 上一轮 /review 的两条建议均已在当前提交落实:新的 modality 测试使用精确形状 toEqual({ image: true, video: true }),install-plan 测试钉住了 preset 的 modalities 字段。

无阻塞项,无规范违反。

测试证据——本 PR 自己的 CI

ubuntu job 中所有 vitest 套件全部通过,包括两个被修改的文件——src/core/modalityDefaults.test.ts ✓(52 个测试)与 src/providers/__tests__/presets/alibaba-standard.test.ts ✓(8 个测试)。但该 job 仍为红,且失败与本 PR 无关:是 test-efficacy 校验器的阳性对照失败("注入的必定失败测试没有把运行染红"),所有探测都报 fatal: '<scratch>/wt-probe' is not a working tree。该校验器向自己的临时 worktree 注入夹具测试,PR 代码没有合理的致因;上一轮 /review 在旧提交上的 mutant 运行也遇到了同类环境失败。判定为 CI 基础设施噪音——维护者重跑该 job 即可确认。

(CI 明细见上方英文表格。)

未验证:端到端行为——选中 qwen3.8-flash 时对图片执行 read_file 是否真的改为原生附带像素、不再走 vision bridge。CI 钉住了分类与 preset 元数据,但没有覆盖真实附带路径。沙箱验证可以补齐:@qwen-code /verify——与 base 构建的 A/B 运行可以展示这两个新分类模型的 bridge 路径消失。(作者有写权限,如需 TUI 走查也可用 @qwen-code /tmux。)

Qwen Code · qwen3.8-max

Reviewed at 16ad5b8d993c7dc4774a4ca2fedb0b4a2e8d7841 · re-run with @qwen-code /triage

@qwen-code-ci-bot

Copy link
Copy Markdown
Collaborator

Confidence: 4/5 — clean, minimal, well-evidenced fix; the only blemish is the red ubuntu check, which the evidence pins on the test-efficacy harness rather than this PR.

Stepping back: this is exactly the kind of PR the gate should wave through. The problem was observed and reproduced with authoritative catalog evidence (#10194), the root cause is verified still present on main, and the fix is the minimum that solves it — two table entries and two preset fields, with regression tests that pin both halves (including the exact-shape pins the earlier review round asked for). My independent proposal matched the PR's approach; I found no simpler path and nothing in the diff I'd maintain grudgingly in six months. The one thing a human should confirm is a re-run of the ubuntu job: every unit suite passed, but the test-efficacy harness's positive control failed on scratch-worktree git errors — infra noise by my reading, and a green re-run would settle it definitively.

Approving on the reviewed commit. ✅

中文说明

置信度:4/5 —— 干净、最小化、证据充分的修复;唯一的瑕疵是红色的 ubuntu 检查,而证据表明那是 test-efficacy 校验器自身的问题,与本 PR 无关。

退一步看:这正是门禁应当放行的那类 PR。问题是真实观测到的,#10194 提供了官方目录证据和复现;根因已确认在 main 上依然存在;修复是解决问题所需的最小集合——两条表项、两个 preset 字段,外加钉住两半改动的回归测试(含上一轮 review 要求的精确形状断言)。我的独立方案与 PR 的做法一致,没有找到更简路径,diff 里也没有任何半年后让人勉强维护的东西。唯一需要人确认的是重跑 ubuntu job:所有单元测试都通过了,但 test-efficacy 校验器的阳性对照因临时 worktree 的 git 错误而失败——我判断是基础设施噪音,一次绿色的重跑即可定论。

已按所审查的提交批准。✅

Qwen Code · qwen3.8-max

Reviewed at 16ad5b8d993c7dc4774a4ca2fedb0b4a2e8d7841 · re-run with @qwen-code /triage

@qwen-code-ci-bot qwen-code-ci-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, looks ready to ship. ✅

@qwen-code-ci-bot qwen-code-ci-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed. Suggestions are inline.

Not explored to full depth (tool budget reached): "agent 6b": run the two test files to confirm green — the review worktree has no node_modules or packages/core/dist (verified), and npm ci + build exceeds the tool bu….

— qwen3.8-max via Qwen Code /review (v0.22.2)

Comment on lines +73 to +74
contextWindowSize: 1000000,
modalities: { image: true, video: true },

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

[Suggestion] R1-1: still stands — the pin delivered in 16ad5b8 is narrower than the original suggestion asked, in two ways.

qwen3.7-plus is still not pinned at all: the install-plan fixture is modelIds: ['qwen3.6-plus', 'custom-model'], and no other test asserts this preset's qwen3.7-plus modalities (the similarly-named pin in alibaba-token-plan.test.ts binds the token-plan preset's separate spec). Removing modalities from the qwen3.7-plus entry in alibaba-standard.ts leaves the whole suite green. And because this qwen3.6-plus pin sits inside a toMatchObject assertion — a recursive subset matcher — adding an extra key to the preset entry's modalities survives it too, whereas the original suggestion's example (and the sibling DeepSeek test below) used exact-shape toEqual.

Both escape routes were verified with mutant runs in a scratch tree at this commit:

baseline (delivered test):                    8 passed
mutant pdf:true on qwen3.6-plus:              8 passed   <- escapes the delivered pin
mutant modalities removed from qwen3.7-plus:  78 passed  <- escapes the delivered pin
exact-shape fix (toEqual, both entries):      both mutants fail

Suggested fix: append qwen3.7-plus to the install-plan fixture and pin both entries exact-shape (appending keeps the existing models?.[0]/models?.[1] assertions unchanged):

modelIds: ['qwen3.6-plus', 'custom-model', 'qwen3.7-plus'],
// ...
expect(models?.[0]?.generationConfig?.modalities).toEqual({
  image: true,
  video: true,
});
expect(models?.[2]?.generationConfig?.modalities).toEqual({
  image: true,
  video: true,
});

Fix witness: this same 'creates an install plan with editable models' test must go red when modalities is removed from either preset entry, and when an extra modality key is added — please confirm with a mutant run (remove the field, run this test, watch it fail).

— qwen3.8-max via Qwen Code /review (v0.22.2)

wenshao and others added 2 commits August 27, 2026 14:29
…fix scoped

The qwen3.6/3.7-plus preset entries are already covered by MODALITY_PATTERNS via the defaultModalities() fallback, so explicit preset metadata is redundant for fixing QwenLM#10194.

@chiga0 chiga0 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

No blocking findings. Approved.

Scope: modalityDefaults.ts + modalityDefaults.test.ts only. The alibaba-standard.ts changes from earlier commits were intentionally dropped (commit 56db59e0) — current diff is 2 files, 18 lines net.

What I checked:

  • Pattern correctness: ^qwen3\.8-flash and ^qwen3\.8-plus are properly anchored (^) and escaped (\.), consistent with all siblings in MODALITY_PATTERNS. Both are inserted before the existing qwen3\.8-max entry — ordering is correct.
  • normalize() contract: normalize() lowercases and strips provider prefixes/suffixes before matching, so Qwen3.8-Flash, bailian/qwen3.8-flash, qwen3.8-flash:latest all resolve to qwen3.8-flash and match. The existing qwen3.8-max-preview test confirms this path.
  • Test validity: Both new tests use toEqual({ image: true, video: true }) — exact match. Adding any extra key (e.g. pdf: true) would fail both tests. Absence is asserted implicitly.
  • catch-all position: The [/^qwen/, {}] text-only catch-all is downstream of the new entries; new patterns win by position.

Cross-check against prior reviews:

Prior finding Status
R1-2 (absent-modality assertion in new tests) Resolved — current tests use toEqual; a mutant adding pdf: true would now fail
R1-1/R2 (alibaba-standard.ts qwen3.7-plus not pinned) Moot — those changes were scoped out in the final commit; the file is not in the diff

CI at head 56db59e0:

Check Result
Test (ubuntu-latest, Node 22.x) in_progress at review time
Test (windows-latest) SKIPPED
Test (macos-latest) SKIPPED
Integration Tests SKIPPED
Desktop Shell (ubuntu, windows) ✅ success

No platform-specific logic in this diff; SKIPPED test platforms are not a coverage gap here. Ubuntu test was still running — if it comes back red, this approval should be revisited.

Reviewed with AI assistance.

@yiliang114
yiliang114 added this pull request to the merge queue Aug 27, 2026
Merged via the queue into QwenLM:main with commit ac513de Aug 27, 2026
55 of 56 checks passed
@qwen-code-ci-bot

Copy link
Copy Markdown
Collaborator

Released in v0.22.3.

wenshao added a commit to yibudak/qwen-code that referenced this pull request Aug 30, 2026
…-max

Resolve five conflicts; main had superseded most of this branch:
- modalityDefaults.ts (+ its test): keep main's newer classification —
  qwen3.8-max is image-only there (QwenLM#10195/QwenLM#10278), not image+video.
- alibaba-token-plan.ts: keep this branch's deepseek-v4-flash entry (the
  part main never landed) and drop its duplicate qwen3.8-max record;
  main's later QwenLM#9383 entry, with thinkingMandatory, is authoritative.
  The matching branch assertion is dropped with it.
- vscode-ide-companion subscriptionPlanDefinitions.{ts,test.ts}: take
  main's version, which now derives the plan list from the shared preset
  instead of the hand-kept copy this branch was updating.

core: alibaba-token-plan + modalityDefaults 62 passed;
vscode-ide-companion subscriptionPlanDefinitions 3 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.

qwen3.8-flash is treated as text-only; alibabaStandard preset carries no modality metadata

5 participants