Skip to content

fix(core): keep qwen3.6-flash and kimi-k2.6 presets text-only#5328

Merged
wenshao merged 1 commit into
QwenLM:mainfrom
he-yufeng:fix/preset-text-only-modalities
Jun 18, 2026
Merged

fix(core): keep qwen3.6-flash and kimi-k2.6 presets text-only#5328
wenshao merged 1 commit into
QwenLM:mainfrom
he-yufeng:fix/preset-text-only-modalities

Conversation

@he-yufeng

Copy link
Copy Markdown
Contributor

What

Drop the stray modalities: { image: true, video: true } from the qwen3.6-flash and kimi-k2.6 entries in the Token Plan preset, and from bailian/kimi-k2.6 in the Idealab preset.

Why

modalityDefaults (packages/core/src/core/modalityDefaults.ts) only treats the multimodal variants — qwen3.6-plus and kimi-k2.5 — as image/video capable; everything else under ^qwen / ^kimi- falls through to the text-only default. These three preset entries declared image/video anyway, which overstates what the models accept and can mislead the vision bridge.

This is the same class of mismatch #5268 fixed for the DeepSeek presets — it just missed the Token Plan and Idealab entries. The genuinely multimodal qwen3.6-plus / kimi-k2.5 entries are left untouched.

Reviewer Test Plan

npx vitest run packages/core/src/providers/__tests__/presets/alibaba-token-plan.test.ts packages/core/src/providers/__tests__/presets/idealab.test.ts

The preset tests now assert qwen3.6-flash and kimi-k2.6 resolve to text-only, and add regression assertions that qwen3.6-plus / kimi-k2.5 keep their image+video modalities.

Risk

Low. Removes overstated modality flags from three text-only presets only; the multimodal Plus/2.5 entries are unchanged and guarded by the new assertions.

modalityDefaults only marks the multimodal variants (qwen3.6-plus,
kimi-k2.5) as image/video capable; qwen3.6-flash and kimi-k2.6 fall
through to the text-only default. The Token Plan and Idealab presets
still declared image/video for them, overstating what the models
accept. Drop the stray modalities so they match the defaults, as a
follow-up to the DeepSeek cleanup in QwenLM#5268.
@wenshao

wenshao commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

@qwen-code /triage

@qwen-code-ci-bot

qwen-code-ci-bot commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the PR!

Template is loosely followed — "What" / "Why" / "Reviewer Test Plan" / "Risk" sections are present and clear. Missing the "Tested on" matrix, "Linked Issues", and "中文说明" sections from the template. Not blocking for a focused data fix like this.

On direction: solid. This is the same class of fix as #5268 (DeepSeek presets) — modalityDefaults.ts only marks qwen3.6-plus and kimi-k2.5 as multimodal, so the Token Plan and Idealab presets shouldn't override that with image: true, video: true on text-only models. Overstating modalities can mislead the vision bridge into sending unsupported media types. Aligned.

On approach: minimal and focused. Three modalities lines removed from two preset files, plus regression assertions ensuring the Plus/2.5 variants stay multimodal. I verified completeness — grep across all presets confirms these are the only entries with the mismatch; alibaba-coding-plan.ts and minimax.ts are consistent with modalityDefaults.ts. No scope creep, exactly the right size.

Moving on to code review. 🔍

中文说明

感谢贡献!

模板大体完整,"What" / "Why" / "Reviewer Test Plan" / "Risk" 都有,但缺少 "Tested on" 矩阵、"Linked Issues" 和 "中文说明"。对于这种小型数据修复不阻塞。

方向:对齐。与 #5268(DeepSeek presets 修复)同类问题——modalityDefaults.ts 只将 qwen3.6-pluskimi-k2.5 标记为多模态,Token Plan 和 Idealab presets 不应在纯文本模型上覆盖 image: true, video: true。夸大多模态能力会导致 vision bridge 发送不支持的媒体类型。

方案:精简聚焦。两个 presets 文件删除三行 modalities,加上回归断言确保 Plus/2.5 变体保持多模态。已验证完整性——grep 所有 presets 确认只有这些条目存在不一致;alibaba-coding-plan.tsminimax.tsmodalityDefaults.ts 一致。没有夹带无关改动。

进入代码审查 🔍

Qwen Code · qwen3.7-max

@qwen-code-ci-bot

qwen-code-ci-bot commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

2a. Code Review

Independent assessment before reading the diff: for text-only models like qwen3.6-flash and kimi-k2.6, the preset shouldn't declare modalities: { image: true, video: true } when modalityDefaults.ts correctly resolves them to text-only via the catch-all patterns (^qwen{}, ^kimi-{}). The fix should remove those overrides and add regression guards.

The PR's approach matches exactly: three modalities lines removed from two preset files, regression assertions added for both the text-only models (qwen3.6-flash, kimi-k2.6, bailian/kimi-k2.6) and the genuinely multimodal ones (qwen3.6-plus, kimi-k2.5). No correctness issues, no security concerns, no AGENTS.md violations. Clean.

2b. Testing

Non-UI change (preset config data) — tmux not applicable. Unit test verification instead:

 ✓ src/providers/__tests__/presets/idealab.test.ts (6 tests) 8ms
 ✓ src/providers/__tests__/presets/alibaba-token-plan.test.ts (2 tests) 6ms

 Test Files  2 passed (2)
      Tests  8 passed (8)
   Duration  7.89s

All 8 tests pass — the updated assertions correctly verify text-only configs for qwen3.6-flash / kimi-k2.6, and the new regression assertions guard the multimodal Plus/2.5 variants. The idealab test gained a dedicated it() block for bailian/kimi-k2.6.

中文说明

2a. 代码审查

对照独立评估审查了 diff:对于 qwen3.6-flashkimi-k2.6 这类纯文本模型,当 modalityDefaults.ts 已通过兜底模式(^qwen{}^kimi-{})正确解析为纯文本时,preset 不应声明 modalities: { image: true, video: true }。删除的三行是夸大能力的无效覆盖。

测试改动结构合理——在 Token Plan 测试中更新 qwen3.6-flash 的现有断言并加入 kimi-k2.6,在 Idealab 测试中为 bailian/kimi-k2.6 添加专用 it()qwen3.6-pluskimi-k2.5 的回归断言是正确的防护。

无正确性问题、无安全隐患、无 AGENTS.md 违规。干净。

2b. 测试

非 UI 改动(preset 配置数据),不适用 tmux。改用单元测试验证:8/8 通过。更新后的断言正确验证了纯文本配置,回归断言保护了多模态变体。

Qwen Code · qwen3.7-max

@qwen-code-ci-bot

qwen-code-ci-bot commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Stepping back: this is a clean, surgical data fix. Three lines of overstated modality flags removed from presets that modalityDefaults.ts already resolves correctly as text-only. The PR author clearly understood the problem — same class of mismatch as #5268, just in presets that were missed.

My independent proposal before seeing the diff was exactly what the PR does: remove the modalities overrides from qwen3.6-flash, kimi-k2.6 in Token Plan, and bailian/kimi-k2.6 in Idealab, then add regression tests. The PR matches the minimal correct fix. I verified completeness by grepping all preset files — no other entries have this mismatch.

Tests confirm the fix works: 8/8 pass, including new regression guards for the genuinely multimodal Plus/2.5 variants. If I had to maintain this in six months, I'd thank the author for keeping it small and well-tested.

Approving. ✅

中文说明

总结:干净、精准的数据修复。从 preset 中删除三行夸大的模态标志,而 modalityDefaults.ts 已正确将这些模型解析为纯文本。PR 作者清楚问题所在——与 #5268 同类问题,只是当时遗漏了这几个 preset。

独立评估与 PR 实现完全一致:移除 Token Plan 的 qwen3.6-flashkimi-k2.6 和 Idealab 的 bailian/kimi-k2.6modalities 覆盖,并添加回归测试。已验证完整性——grep 所有 preset 文件确认没有其他条目存在同样问题。测试确认修复有效:8/8 通过,包含对真正多模态 Plus/2.5 变体的回归保护。

批准。✅

Qwen Code · qwen3.7-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.

LGTM, looks ready to ship. ✅

@wenshao

wenshao commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

✅ Local build & verification — LGTM, ready to merge

Built the real artifacts from this PR's HEAD and verified the change end-to-end, including the shipped CLI chunk and the runtime modality fallback it relies on. Correct, complete, well-guarded by tests. Recommending merge.

What this PR does

Removes the overstated modalities: { image: true, video: true } from three text-only preset entries — qwen3.6-flash & kimi-k2.6 (Token Plan) and bailian/kimi-k2.6 (Idealab) — so they fall through to the text-only default in modalityDefaults.ts. The genuinely multimodal qwen3.6-plus / kimi-k2.5 entries are left untouched. Same class of mismatch as #5268 (DeepSeek presets).

Environment

  • macOS (Darwin 25.5.0), Node v22.22.2, npm 10.9.7
  • Worktree on PR HEAD b987ad9465; base origin/main (12 commits behind but MERGEABLE; the 4 changed files are clean against origin/main).

Why it's correct (data flow)

buildGenerationConfig (provider-config.ts) only emits generationConfig.modalities when the ModelSpec declares it with a truthy value:

if (spec.modalities && Object.values(spec.modalities).some(Boolean)) {
  parts.modalities = spec.modalities;
}

So dropping the field makes the key absent, and at runtime the model resolves through defaultModalities(model). I exercised that real function for the affected ids:

model id defaultModalities() result
qwen3.6-flash text-only {}
kimi-k2.6 text-only {}
bailian/kimi-k2.6 (provider-prefixed) text-only {} ✅ (normalize() strips bailian/)
qwen3.6-plus { image: true, video: true } (unchanged) ✅
kimi-k2.5 { image: true, video: true } (unchanged) ✅

The fix simply makes the presets agree with defaultModalities. This is already the idiomatic pattern in the repo — e.g. alibaba-standard.ts lists qwen3.6-plus with no explicit modalities and relies on the default.

Verification matrix

Check Command / method Result
Preset unit tests vitest run …/alibaba-token-plan.test.ts …/idealab.test.ts ✅ 8 passed
Runtime modality fallback call real defaultModalities() for all 5 ids ✅ table above
Mutation A/B re-add modalities to qwen3.6-flash in src, rebuild core, re-run ✅ test fails with + "modalities": { image, video } in the diff → genuine guard. Restore + rebuild → passes
Completeness / blast-radius grep all presets for the 3 model ids ✅ these are the only presets declaring them multimodal — none missed
Typecheck tsc --noEmit (packages/core) ✅ clean
Lint eslint (4 changed files) ✅ clean
Format prettier --check (4 files) ✅ clean
Whitespace git diff --check ✅ clean
Real build npm run build + npm run bundle ✅ both exit 0
Fix in shipped artifact grep compiled core dist + CLI chunk ✅ see below
Built binary boots node dist/cli.js --version 0.18.3

Fix confirmed in the shipped artifacts

Inspected the compiled @qwen-code/qwen-code-core dist and the CLI's code-split chunk (dist/chunks/chunk-*.js, where the provider presets actually ship — they're tree-shaken out of the main dist/cli.js):

  • qwen3.6-flash, kimi-k2.6, bailian/kimi-k2.6contextWindowSize + enableThinking, no modalities
  • qwen3.6-plus, kimi-k2.5 → still carry modalities: { image: true, video: true }

These presets are consumed by the real CLI provider-setup flow (useAuth.ts, useProviderSetupFlow.ts, acpAgent.ts, runQwenServe.ts), so the fix has genuine user-facing effect.

Notes (non-blocking)

  • Test layer: packages/core tests resolve @qwen-code/qwen-code-core to the compiled dist/ (no vitest src alias), so a source-only edit needs a core rebuild to be reflected — the mutation A/B above accounts for this (mutate src → rebuild → test fails).

Verdict: LGTM ✅ — a clean, complete data-consistency fix; presets now match modalityDefaults, multimodal variants preserved, and the new assertions guard against regression.

🇨🇳 中文版(点击展开)

✅ 本地构建验证 — LGTM,可以合并

我从该 PR 的 HEAD 在本地构建了真实产物,并端到端验证了改动,包括 CLI 实际发布的 chunk 以及它依赖的运行时 modality 回退逻辑。改动正确、完整、且有测试守护。建议合并。

这个 PR 做了什么

从三个纯文本预设条目中移除了被夸大的 modalities: { image: true, video: true } —— Token Plan 的 qwen3.6-flashkimi-k2.6,以及 Idealab 的 bailian/kimi-k2.6 —— 让它们回落到 modalityDefaults.ts 里的纯文本默认值。真正多模态的 qwen3.6-plus / kimi-k2.5 条目保持不动。和 #5268(DeepSeek 预设)是同一类不一致问题。

环境

  • macOS(Darwin 25.5.0)、Node v22.22.2、npm 10.9.7
  • worktree 检出在 PR HEAD b987ad9465;base 为 origin/main(落后 12 个提交,但 MERGEABLE;4 个改动文件相对 origin/main 干净)。

为什么是对的(数据流)

buildGenerationConfig(provider-config.ts)只有在 ModelSpec 显式声明且有真值时才会写入 generationConfig.modalities:

if (spec.modalities && Object.values(spec.modalities).some(Boolean)) {
  parts.modalities = spec.modalities;
}

所以删掉该字段后这个 key 就不存在了,运行时该模型会走 defaultModalities(model) 解析。我用真实的这个函数跑了受影响的 id:

模型 id defaultModalities() 结果
qwen3.6-flash 纯文本 {}
kimi-k2.6 纯文本 {}
bailian/kimi-k2.6(带 provider 前缀) 纯文本 {} ✅(normalize() 会剥掉 bailian/)
qwen3.6-plus { image: true, video: true }(不变)✅
kimi-k2.5 { image: true, video: true }(不变)✅

这个修复本质上就是让预设和 defaultModalities 保持一致。而且这在仓库里本来就是惯用写法 —— 比如 alibaba-standard.ts 里的 qwen3.6-plus 就没显式写 modalities,直接靠默认值。

验证矩阵

检查项 命令 / 方法 结果
预设单元测试 vitest run …/alibaba-token-plan.test.ts …/idealab.test.ts ✅ 8 通过
运行时 modality 回退 对 5 个 id 调用真实的 defaultModalities() ✅ 见上表
变异 A/B srcqwen3.6-flash 重新加回 modalities,重新构建 core,再跑 ✅ 测试失败,diff 里出现 + "modalities": { image, video } → 是有效守卫。还原 + 重建 → 通过
完整性 / 影响范围 grep 所有预设里这 3 个模型 id ✅ 这些是唯一把它们声明为多模态的预设 —— 没有遗漏
类型检查 tsc --noEmit(packages/core) ✅ 干净
Lint eslint(4 个改动文件) ✅ 干净
格式 prettier --check(4 个文件) ✅ 干净
空白字符 git diff --check ✅ 干净
真实构建 npm run build + npm run bundle ✅ 均 exit 0
修复进入发布产物 grep 编译后的 core dist + CLI chunk ✅ 见下
构建出的二进制可启动 node dist/cli.js --version 0.18.3

修复已在发布产物中确认

检查了编译后的 @qwen-code/qwen-code-core dist,以及 CLI 的代码分块 chunk(dist/chunks/chunk-*.js —— 预设实际打包在这里,它们被 tree-shaking 从主 dist/cli.js 里移除了):

  • qwen3.6-flashkimi-k2.6bailian/kimi-k2.6 → 只有 contextWindowSize + enableThinking,没有 modalities
  • qwen3.6-pluskimi-k2.5 → 仍然带 modalities: { image: true, video: true }

这些预设被真实的 CLI provider 配置流程消费(useAuth.tsuseProviderSetupFlow.tsacpAgent.tsrunQwenServe.ts),所以这个修复对用户是真实可见的。

备注(均不阻塞)

  • 测试层: packages/core 的测试把 @qwen-code/qwen-code-core 解析到编译后的 dist/(vitest 没有配 src alias),所以只改源码、不重建 core 的话测试看到的是旧产物 —— 上面的变异 A/B 已经考虑到这点(改 src → 重建 → 测试失败)。

结论:LGTM ✅ —— 一个干净、完整的数据一致性修复;预设现在和 modalityDefaults 对齐,多模态变体保持不变,新增断言能守住回归。

@wenshao

wenshao commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

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

@wenshao
wenshao merged commit 0137128 into QwenLM:main Jun 18, 2026
31 checks 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.

3 participants