fix(core): recognize new DeepSeek/GLM vision models in modality defaults - #10285
fix(core): recognize new DeepSeek/GLM vision models in modality defaults#10285jarvislee90s-dot wants to merge 2 commits into
Conversation
|
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 |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
@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 —
mainmatches/^deepseek-.*vision/, which coversdeepseek-v4-flash-vision-exp - GLM v-suffix family —
mainmatches/^glm-[0-9.]+v/, which coversglm-4.5v/glm-4.6v/glm-5v-turboand is broader than this PR's variant glm-5.3-flash—mainalready returnsimage
Remaining delta against main:
- The
vlalternative: your/^deepseek-.*(vision|vl)/also matchesdeepseek-vl2/deepseek-vl-chat, which onmainstill fall through to text-only. glm-5.3-flashgainsvideo+pdfhere;mainonly grantsimage.
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 的剩余差异:
vl分支:你的/^deepseek-.*(vision|vl)/还能匹配deepseek-vl2/deepseek-vl-chat,而它们在main上仍会落入纯文本默认。glm-5.3-flash在本 PR 中额外获得video+pdf;main只给了image。
因此这不是纯粹的重复,但大部分改动已经合入。请 rebase 到 main,把本 PR 缩减到上述两处差异——只保留钉住这两处差异的测试(deepseek-v4-flash-vision-exp、glm-4.6v、glm-5v-turbo 的用例在 main 上本来就能通过;deepseek-vl* 用例和 glm-5.3-flash 的 video/pdf 断言才是真正捕获差异的部分)——或者如果你认为没有剩余价值,也可以直接关闭。
— Qwen Code · qwen3.8-max
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>
What this PR does
Extends the modality auto-detection table (
MODALITY_PATTERNSinpackages/core/src/core/modalityDefaults.ts) so the new vision-capable models are recognized without a manualmodalitiesoverride: DeepSeek vision variants (deepseek-v4-flash-vision-exp, andvl-suffixed naming), the GLM v-suffix family (glm-4.5v/glm-4.6v/glm-5v-turbo), andglm-5.3-flash(image + video + pdf per BigModel docs, 2026-08). Text-only defaults for the rest of both families are unchanged, and explicitmodalitiesoverrides keep taking precedence.Why it's needed
Fixes #10270. The documented behavior in
docs/users/configuration/settings.mdsays 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
npx vitest run src/core/modalityDefaults.test.ts(frompackages/core) — new cases coverdeepseek-v4-flash-vision-exp,deepseek-vl2/deepseek-vl-chat,glm-4.6v,glm-5v-turbo,glm-5.3-flash, plus negative controls (deepseek-v3v-prefixed text model,glm-5.3non-flash) that pin the pattern boundaries.deepseek-v4-flash-vision-expwithout anymodalitiesoverride 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):
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):The session transcript confirms the image entered the request as an
inlineDatapart (both the user-message path and theread_filetool-result path) with no[Unsupported image fileplaceholder. Same result withglm-5.3-flashvia the GLM coding-plan endpoint (model describes the terminal screenshot contents in detail).Tested on
Environment (optional)
Local source build (
npm run build+ non-interactive CLI), Node.js ≥22 on Windows; unit tests (60/60 inmodalityDefaults.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
vision/vl/vnaming still need new entries (structural maintenance cost of the table, noted on Modality auto-detection doesn't recognize new DeepSeek/GLM vision models — silent image placeholder unless manually overriding modalities #10270); making the placeholder replacement a user-visible warning is tracked as an optional follow-up on Modality auto-detection doesn't recognize new DeepSeek/GLM vision models — silent image placeholder unless manually overriding modalities #10270.Linked Issues
Fixes #10270
中文说明
本 PR 的改动
扩展模态自动检测表(
packages/core/src/core/modalityDefaults.ts的MODALITY_PATTERNS),使新发布的视觉模型无需手动modalities覆盖即可被识别:DeepSeek 视觉变体(deepseek-v4-flash-vision-exp及vl后缀命名)、GLM v 后缀家族(glm-4.5v/glm-4.6v/glm-5v-turbo)、以及glm-5.3-flash(按 BigModel 文档 2026-08 支持 image + video + pdf)。两个家族其余模型的纯文本默认不变,显式modalities覆盖依然优先。为什么需要此改动
修复 #10270。
docs/users/configuration/settings.md文档承诺 Qwen Code 会"基于模型名模式自动检测支持的模态";检测表早于这些模型,不知道覆盖项的用户会静默丢失图片输入(图片被替换为文本占位符、仅有一条 debug 级日志,且这些模型被排除在 vision bridge 候选之外)。#10270 的 triage 已确认该缺口与修复方向。审查者测试计划
验证方式
packages/core下运行npx vitest run src/core/modalityDefaults.test.ts—— 新用例覆盖deepseek-v4-flash-vision-exp、deepseek-vl2/deepseek-vl-chat、glm-4.6v、glm-5v-turbo、glm-5.3-flash,以及钉住模式边界的负例(deepseek-v3v 前缀文本模型、glm-5.3非 flash)。deepseek-v4-flash-vision-exp且不写任何modalities覆盖,引用一张图片 —— 模型应能直接描述图片,而不是收到[Unsupported image file: …]占位符。证据(修复前后)
修复前(v0.22.2,无覆盖 —— 图片被静默替换为占位符,模型表示看不到;完整 transcript 证据见 #10270):
修复后(本 PR,本地源码构建,同样不写覆盖,非交互
qwen -m deepseek-v4-flash-vision-exp -p "@<图片> 这张图片里是什么内容?请具体描述",DeepSeek 官方端点):会话 transcript 确认图片以
inlineDatapart 进入请求(用户消息路径与read_file工具结果路径均验证),[Unsupported image file占位符完全消失。GLM coding plan 端点 +glm-5.3-flash同样验证通过(模型详细描述了终端截图内容)。测试平台
环境(可选)
本地源码构建(
npm run build+ 非交互 CLI),Windows / Node.js ≥22;改动文件的单测(modalityDefaults.test.ts60/60)、ESLint、typecheck、Prettier 全部通过;端到端对 DeepSeek 官方 API 与智谱 GLM Coding Plan 端点实测通过。风险与范围
vision/vl/v命名的视觉模型仍需补条目(检测表的结构性维护成本,已在 Modality auto-detection doesn't recognize new DeepSeek/GLM vision models — silent image placeholder unless manually overriding modalities #10270 说明);把占位符替换改为用户可见警告是 Modality auto-detection doesn't recognize new DeepSeek/GLM vision models — silent image placeholder unless manually overriding modalities #10270 记录的可选后续。关联 Issue
Fixes #10270