Skip to content

@image attachments fail in env-var-only mode — modalities never auto-detected #4219

@filipmihal

Description

@filipmihal

What happened?

When qwen-code is configured only via env vars (OPENAI_API_KEY, OPENAI_BASE_URL, OPENAI_MODEL) — i.e. no modelProviders entry in settings.json@filename image attachments are silently replaced with a text placeholder:

[Unsupported <modality> file: "<name>". This model does not support <modality> input. ...]

This happens even when defaultModalities() would correctly mark the model as image-capable (the regex /^qwen3\.6-35b/ in modalityDefaults.ts matches qwen3.6-35b-a3b after normalize()).

Setup: qwen-code pointed at a local vLLM server hosting Qwen/Qwen3.6-35B-A3B (a multimodal Qwen3.x model)

What did you expect to happen?

The env-var-only path should also call defaultModalities(model) when generationConfig.modalities is undefined, matching the behavior of the modelProviders path.

Client information

Client Information

Run qwen to enter the interactive CLI, then run the /about command.

$ qwen /about
# paste output here

Login information

No response

Anything else we need to know?

No response

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions