Skip to content

fix(core): recognize new DeepSeek/GLM vision models in modality defaults - #10285

Closed
jarvislee90s-dot wants to merge 2 commits into
QwenLM:mainfrom
jarvislee90s-dot:fix/modality-defaults-vision-models
Closed

fix(core): recognize new DeepSeek/GLM vision models in modality defaults#10285
jarvislee90s-dot wants to merge 2 commits into
QwenLM:mainfrom
jarvislee90s-dot:fix/modality-defaults-vision-models

Conversation

@jarvislee90s-dot

Copy link
Copy Markdown

What this PR does

Extends the modality auto-detection table (MODALITY_PATTERNS in packages/core/src/core/modalityDefaults.ts) so the new vision-capable models are recognized without a manual modalities override: DeepSeek vision variants (deepseek-v4-flash-vision-exp, and vl-suffixed naming), the GLM v-suffix family (glm-4.5v/glm-4.6v/glm-5v-turbo), and glm-5.3-flash (image + video + pdf per BigModel docs, 2026-08). Text-only defaults for the rest of both families are unchanged, and explicit modalities overrides keep taking precedence.

Why it's needed

Fixes #10270. The documented behavior in docs/users/configuration/settings.md says Qwen Code "automatically detects supported modalities … based on model name pattern matching"; the detection table predates these models, so users who don't know about the override silently lose image input (the image is swapped for a text placeholder with only a debug-level log, and these models are excluded from vision-bridge candidates). The triage on #10270 confirmed the gap and this fix direction.

Reviewer Test Plan

How to verify

  1. npx vitest run src/core/modalityDefaults.test.ts (from packages/core) — new cases cover deepseek-v4-flash-vision-exp, deepseek-vl2/deepseek-vl-chat, glm-4.6v, glm-5v-turbo, glm-5.3-flash, plus negative controls (deepseek-v3 v-prefixed text model, glm-5.3 non-flash) that pin the pattern boundaries.
  2. Optionally, build from source and run with a custom OpenAI-compatible provider: select deepseek-v4-flash-vision-exp without any modalities override and reference an image — the model should now describe the image instead of receiving the [Unsupported image file: …] placeholder.

Evidence (Before & After)

Before (v0.22.2, no override — image silently replaced by the placeholder, model reports it cannot see it; full transcript evidence on #10270):

before

After (this PR, local source build, same model entry still without override, non-interactive qwen -m deepseek-v4-flash-vision-exp -p "@<image> 这张图片里是什么内容?请具体描述", DeepSeek official endpoint):

识别出 Qwen Code CLI v0.22.2 深色终端界面、QWEN 蓝粉渐变 logo、状态栏,并正确读出截图内嵌的历史对话内容("宝蓝色西装外套、白色衬衫未系领带、佩戴眼镜、讲台前对着麦克风发言")

The session transcript confirms the image entered the request as an inlineData part (both the user-message path and the read_file tool-result path) with no [Unsupported image file placeholder. Same result with glm-5.3-flash via the GLM coding-plan endpoint (model describes the terminal screenshot contents in detail).

Tested on

OS Status
🍏 macOS ⚠️ not tested
🪟 Windows ✅ tested
🐧 Linux ⚠️ not tested

Environment (optional)

Local source build (npm run build + non-interactive CLI), Node.js ≥22 on Windows; unit tests (60/60 in modalityDefaults.test.ts), ESLint, typecheck, and Prettier pass on the changed files; end-to-end verified against the DeepSeek official API and the Zhipu GLM Coding Plan endpoint.

Risk & Scope

Linked Issues

Fixes #10270

中文说明

本 PR 的改动

扩展模态自动检测表(packages/core/src/core/modalityDefaults.tsMODALITY_PATTERNS),使新发布的视觉模型无需手动 modalities 覆盖即可被识别:DeepSeek 视觉变体(deepseek-v4-flash-vision-expvl 后缀命名)、GLM v 后缀家族(glm-4.5v/glm-4.6v/glm-5v-turbo)、以及 glm-5.3-flash(按 BigModel 文档 2026-08 支持 image + video + pdf)。两个家族其余模型的纯文本默认不变,显式 modalities 覆盖依然优先。

为什么需要此改动

修复 #10270docs/users/configuration/settings.md 文档承诺 Qwen Code 会"基于模型名模式自动检测支持的模态";检测表早于这些模型,不知道覆盖项的用户会静默丢失图片输入(图片被替换为文本占位符、仅有一条 debug 级日志,且这些模型被排除在 vision bridge 候选之外)。#10270 的 triage 已确认该缺口与修复方向。

审查者测试计划

验证方式

  1. packages/core 下运行 npx vitest run src/core/modalityDefaults.test.ts —— 新用例覆盖 deepseek-v4-flash-vision-expdeepseek-vl2/deepseek-vl-chatglm-4.6vglm-5v-turboglm-5.3-flash,以及钉住模式边界的负例(deepseek-v3 v 前缀文本模型、glm-5.3 非 flash)。
  2. 可选:源码构建,配置自定义 OpenAI 兼容 provider,选择 deepseek-v4-flash-vision-exp不写任何 modalities 覆盖,引用一张图片 —— 模型应能直接描述图片,而不是收到 [Unsupported image file: …] 占位符。

证据(修复前后)

修复前(v0.22.2,无覆盖 —— 图片被静默替换为占位符,模型表示看不到;完整 transcript 证据见 #10270):

修复前

修复后(本 PR,本地源码构建,同样不写覆盖,非交互 qwen -m deepseek-v4-flash-vision-exp -p "@<图片> 这张图片里是什么内容?请具体描述",DeepSeek 官方端点):

识别出 Qwen Code CLI v0.22.2 深色终端界面、QWEN 蓝粉渐变 logo、状态栏,并正确读出截图内嵌的历史对话内容("宝蓝色西装外套、白色衬衫未系领带、佩戴眼镜、讲台前对着麦克风发言")

会话 transcript 确认图片以 inlineData part 进入请求(用户消息路径与 read_file 工具结果路径均验证),[Unsupported image file 占位符完全消失。GLM coding plan 端点 + glm-5.3-flash 同样验证通过(模型详细描述了终端截图内容)。

测试平台

操作系统 状态
macOS ⚠️ 未测试
Windows ✅ 已测试
Linux ⚠️ 未测试

环境(可选)

本地源码构建(npm run build + 非交互 CLI),Windows / Node.js ≥22;改动文件的单测(modalityDefaults.test.ts 60/60)、ESLint、typecheck、Prettier 全部通过;端到端对 DeepSeek 官方 API 与智谱 GLM Coding Plan 端点实测通过。

风险与范围

关联 Issue

Fixes #10270

@github-actions github-actions Bot added the review/self-reported The linked issue was opened by the PR author (self-reported) label Aug 27, 2026
@qwen-code-ci-bot

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

Copy link
Copy Markdown
Collaborator

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

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

@yiliang114

Copy link
Copy Markdown
Collaborator

Thanks for the detailed PR and the before/after evidence — the investigation on #10270 was genuinely helpful.

This one is a duplicate of #10278, which already landed on main and fixed the same gap (the new DeepSeek/GLM vision model patterns in the modality auto-detection table). #10270 was closed as fixed by that merge, about an hour before this PR was opened, so there is nothing left for this PR to fix. Closing in favor of #10278 — if you spot any model pattern that #10278 still misses, a follow-up PR or a comment on #10270 would be welcome.

中文说明

感谢这个 PR 和修复前后的验证证据 —— #10270 上的排查很有价值。

本 PR 与 #10278 重复:#10278 已合入 main,修复了同一个问题(模态自动检测表对新 DeepSeek/GLM 视觉模型的识别)。#10270 已在那次合并后约一小时被关闭(已修复),因此本 PR 没有可修复的剩余问题。现关闭,以 #10278 为准 —— 如果你发现 #10278 仍遗漏了某些模型模式,欢迎提后续 PR 或在 #10270 留言。

@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.

@jarvislee90s-dot The linked issue #10270 was already fixed before this PR was opened: #10278 landed on main about an hour earlier and extended the same MODALITY_PATTERNS table. Comparing this PR's production diff (only packages/core/src/core/modalityDefaults.ts) against main:

Already on main (via #10278):

  • DeepSeek vision naming — main matches /^deepseek-.*vision/, which covers deepseek-v4-flash-vision-exp
  • GLM v-suffix family — main matches /^glm-[0-9.]+v/, which covers glm-4.5v / glm-4.6v / glm-5v-turbo and is broader than this PR's variant
  • glm-5.3-flashmain already returns image

Remaining delta against main:

  1. The vl alternative: your /^deepseek-.*(vision|vl)/ also matches deepseek-vl2 / deepseek-vl-chat, which on main still fall through to text-only.
  2. glm-5.3-flash gains video + pdf here; main only grants image.

So this is not a clean duplicate, but most of it is already shipped. Please rebase onto main and reduce this PR to those two deltas — keeping only the tests that pin them (the deepseek-v4-flash-vision-exp, glm-4.6v, and glm-5v-turbo cases pass against main as-is; the deepseek-vl* cases and the glm-5.3-flash video/pdf assertions are the ones that capture the delta) — or close it if you agree nothing is left worth keeping.

中文说明

@jarvislee90s-dot 关联 issue #10270 在本 PR 提交前已经修复:#10278 约一小时前已合入 main,扩展的正是同一张 MODALITY_PATTERNS 表。将本 PR 的生产代码 diff(仅 packages/core/src/core/modalityDefaults.ts)与 main 对比:

已在 main 上(来自 #10278):

  • DeepSeek vision 命名 —— main/^deepseek-.*vision/ 已覆盖 deepseek-v4-flash-vision-exp
  • GLM v 后缀家族 —— main/^glm-[0-9.]+v/ 已覆盖 glm-4.5v / glm-4.6v / glm-5v-turbo,且比本 PR 的写法更宽
  • glm-5.3-flash —— main 已返回 image

相对 main 的剩余差异:

  1. vl 分支:你的 /^deepseek-.*(vision|vl)/ 还能匹配 deepseek-vl2 / deepseek-vl-chat,而它们在 main 上仍会落入纯文本默认。
  2. glm-5.3-flash 在本 PR 中额外获得 video + pdfmain 只给了 image

因此这不是纯粹的重复,但大部分改动已经合入。请 rebase 到 main,把本 PR 缩减到上述两处差异——只保留钉住这两处差异的测试(deepseek-v4-flash-vision-expglm-4.6vglm-5v-turbo 的用例在 main 上本来就能通过;deepseek-vl* 用例和 glm-5.3-flash 的 video/pdf 断言才是真正捕获差异的部分)——或者如果你认为没有剩余价值,也可以直接关闭。

Qwen Code · qwen3.8-max

@yiliang114 yiliang114 closed this Aug 27, 2026
@jarvislee90s-dot
jarvislee90s-dot deleted the fix/modality-defaults-vision-models branch August 28, 2026 00:43
pull Bot pushed a commit to Little-Star888/qwen-code that referenced this pull request Aug 28, 2026
The `Check triage response` step of qwen-triage.yml classified any
non-empty response as a successful triage. A model-layer API error
response ("[API Error: Connection error. ...]", 268 chars) is a
non-empty string, so run 33070765162 (triage for QwenLM#10285) reported
success, posted nothing, and no retry or alert fired.

Strip the known rate-limit guidance suffixes, right-trim, and fail the
step when the response ends with the "[API Error: ...]" shape -- the
pattern qwen-code-pr-review.yml already uses for the same CLI output
behavior (the stream-json adapter appends the formatted error last).
This covers both bare error responses and errors appended after partial
output, while a legitimate summary that merely quotes an API error
mid-prose stays green. The existing failure surface then engages: red
run, "ended early" lifecycle comment, re-run path.

Adds executed-step tests in scripts/tests/qwen-triage-workflow.test.js
following the existing check-step harness: the verbatim 268-char
response, an appended-error response, and a quota error with its
guidance suffix must fail; a quoted-error summary, a normal response,
empty, and 'null' keep their existing behavior.

Fixes QwenLM#10314

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review/self-reported The linked issue was opened by the PR author (self-reported)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Modality auto-detection doesn't recognize new DeepSeek/GLM vision models — silent image placeholder unless manually overriding modalities

3 participants