Skip to content

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

Description

@efwds

Summary

qwen3.8-flash is classified as text-only by the client modality auto-detect, even though the
ModelStudio endpoint accepts image and video input. The practical effect: inline media never
reaches the model as pixels — read_file on an image/PDF is silently routed through the vision
bridge (a second, separately billed model call) and I receive a lossy text transcription instead.

Two distinct problems are involved:

  1. MODALITY_PATTERNS in packages/core/src/core/modalityDefaults.ts has no rule for the
    qwen3.8-flash / qwen3.8-plus families (only qwen3.8-max), so they fall through to the
    catch-all [/^qwen/, {}].
  2. The alibabaStandard provider preset carries no modalities metadata at all, so Standard
    API-key users have no path to correct capability data other than hand-editing settings.json.

Environment

  • Qwen Code 0.22.2 (npm latest at time of writing — not a stale-install issue)
  • Windows 11, security.auth.selectedType = "openai"
  • Provider: alibabaStandard ("Standard API Key"), baseUrl = https://dashscope.aliyuncs.com/compatible-mode/v1
  • Model: qwen3.8-flash (entered manually via /model; not present in the preset list)

Authoritative capability data

qianwen models info qwen3.8-flash --format json (CLI session auth, 2026-08-27) returns:

"modality": { "input": ["image", "text", "video"], "output": ["text"] },
"context": { "context_window": 1000000, "max_input": 991808, "max_output": 131072 }

So the model does accept image and video input. pdf and audio are not accepted.

Reproduction

  1. Select qwen3.8-flash on the alibabaStandard provider and restart the session.
  2. read_file any PNG.

Observed: the tool result is not an image but a bridge transcription block headed
[Untrusted machine transcription of 1 image(s) by qwen3.6-plus ... The image cannot be read by any tool]. The assistant receives second-hand text and an extra billed call is incurred per image.

Expected: the image is attached natively ([media attached in following user message]) and the
selected model sees the pixels.

Confirmed by experiment with a synthetic image containing the string ZEBRA 7749: before the
workaround only the transcription was available; after the workaround the model reported genuine
pixel-level detail (subpixel red/cyan fringing on the glyphs) that the transcription never conveyed.

Root cause

1. The auto-detect table is fail-closed and lags model releases (by design)

defaultModalities() documents the intent: "Unknown models default to text-only (empty object) to
avoid sending unsupported media types that would cause unrecoverable API errors."
The table was
introduced by fix: add modality defaults to prevent API errors when reading PDFs (2026-02-27) and
has since grown purely by reactive per-model PRs:

Date Commit
2026-04-08 add qwen3.6-plus
2026-05-15 add Qwen3.6-35B quant variants
2026-06-02 add MiniMax-M3
2026-06-08 add qwen3.7-plus multimodal
2026-06-20 add missing Token Plan models
2026-07-22 fix(core): add image modality support for qwen3.8-max and kimi-k3 models (#7491)
2026-08-04 resolve DashScope thinking-knob conflicts by family

The last edit to this file is 2026-08-04, whereas qwen3.8-flash's catalog entry was updated
2026-08-25. The 3.8 series entered the table incrementally (max only), and isTieredEffortWireModel()
shows the same shape — it also matches only qwen3.8-max. So flash/plus simply have not been
added yet. main still has no rule for them as of today.

2. Capability knowledge is duplicated across three lists that drift independently

List Location Carries modalities? Covers 3.8 series
Regex fallback core/src/core/modalityDefaults.ts yes max only
VISION_MODEL_PREFIX_PATTERNS DashScopeOpenAICompatibleProvider yes no — stops at qwen3.7-plus
Provider presets providers/presets/*.ts depends on the preset see below

3. alibabaStandard declares no modality metadata, unlike the plan presets

providers/presets/alibaba-token-plan.ts does carry it, e.g.:

{ id: "qwen3.8-max", contextWindowSize: 1e6, enableThinking: true,
  thinkingMandatory: true, modalities: { image: true, video: true } },

providers/presets/alibaba-standard.ts does not — its whole model list is six entries with only
contextWindowSize / enableThinking, no modalities, no 3.8-series model, and no
supportsModelDiscovery (both plan presets set that flag; Standard does not):

models: [
  { id: "qwen3.6-plus", contextWindowSize: 1e6, enableThinking: true },
  { id: "qwen3.7-plus", contextWindowSize: 1e6, enableThinking: true },
  { id: "qwen3.7-max",  contextWindowSize: 1e6, enableThinking: true },
  { id: "glm-5.1",      contextWindowSize: 202752, enableThinking: true },
  { id: "deepseek-v4-pro", contextWindowSize: 1e6, enableThinking: true },
  { id: "deepseek-v4-flash", contextWindowSize: 1e6 },
],

Consequently, on the Standard path even preset-known models get no capability metadata and fall
through to the regex table. And because qwen3.8-flash is typed in manually, buildModelConfigs()
takes the inputs.modelIds branch for an id absent from the preset spec map, so the emitted
generationConfig comes only from whatever the user filled in the advanced steps — which is nothing
by default.

Workaround (and why it is fragile)

Declaring the modalities explicitly on the provider entry fixes it, and the correct persisted key is
modalitiesnot multimodal, which is only the interactive /model wizard's input shape and
is silently ignored when written into settings.json (this cost me one wasted edit; a schema
warning for unknown generationConfig keys would help):

{
  "id": "qwen3.8-flash",
  "baseUrl": "https://dashscope.aliyuncs.com/compatible-mode/v1",
  "envKey": "DASHSCOPE_API_KEY",
  "generationConfig": {
    "modalities": { "image": true, "video": true },
    "contextWindowSize": 1000000
  }
}

However this setting is not sticky within a session: shouldUpdateModelDerivedDefault() treats
kind === "modelProviders" as overridable, so applyRawModelDerivedDefaults() re-runs
defaultModalities() on a raw /model switch and silently reverts image support to {} until the
process restarts. Arguably a separate bug: a value the user explicitly pinned in settings.json
should not be treated as a computed default.

Suggested fixes

  1. Add qwen3.8-flash ({ image: true, video: true }) and a qwen3.8-plus rule to
    MODALITY_PATTERNS, before the /^qwen/ catch-all.
  2. Give the alibabaStandard preset the same modalities metadata the Token Plan preset already has,
    and consider supportsModelDiscovery for it.
  3. Longer term, derive per-model modality from an authoritative catalog instead of hand-copied lists —
    the data already exists server-side (modality.input), and the three client-side lists above are
    demonstrably out of sync with each other.
  4. Treat user-authored settings.json generationConfig.modalities as a pinned source so raw model
    switches do not silently discard it.
  5. Warn (or fail) on unknown keys inside generationConfig, to catch the multimodal/modalities
    mix-up.

Related

I found no existing report for qwen3.8-flash / qwen3.8-plus specifically.

Metadata

Metadata

Assignees

Labels

category/coreCore engine and logicpriority/P2Medium - Moderately impactful, noticeable problemscope/coretype/bugSomething isn't working as expected

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions