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.
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
I have a minimal local reproduction and am preparing a regression PR.