Skip to content

Qwen-VL: literal vision marker in text is parsed as extra image when request contains an image #35582

Description

@sudeposutemizligi

Reproduction

A Qwen-VL chat request containing one valid image_url part and ordinary text containing the literal Qwen sequence <|vision_start|><|image_pad|><|vision_end|> returns HTTP 500.

The text is harmless in a text-only request because the multimodal processor is not invoked. Once any real image exists, legacy_load_mm_data() regex-scans the fully rendered prompt and cannot distinguish a marker emitted by the chat template from the same sequence supplied inside a text or tool-result block.

Expected behavior

Text and tool output should be allowed to contain Qwen special-token spellings without being treated as another attachment. At minimum this should be a client error, rather than a 500.

Environment

  • SGLang 0.5.16
  • Qwen3.8-27B
  • OpenAI-compatible chat completions

I have a minimal local reproduction and am preparing a regression PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions