{"record":{"id":"45edd74219f8a2db","repo":"sgl-project/sglang","slug":"unsupported-preprocessed-video-item-item-type","errorCode":null,"errorMessage":"Unsupported preprocessed video item: {item_type}","messagePattern":"Unsupported preprocessed video item: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/srt/multimodal/processors/dots_note_omni.py","lineNumber":273,"sourceCode":"        content: list[dict],\n    ) -> tuple[str, dict[str, tuple[Modality, str]]]:\n        \"\"\"Insert one expanded video while retaining its media ordering.\"\"\"\n        rendered = []\n        media = {}\n        for item in content:\n            item_type = item.get(\"type\")\n            if item_type == \"text\":\n                rendered.append(item.get(\"text\", \"\"))\n            elif item_type == \"image_url\":\n                marker = f\"<|sglang_dots_video_{video_index}_image_{len(media)}|>\"\n                media[marker] = (Modality.IMAGE, item[\"image_url\"][\"url\"])\n                rendered.append(marker)\n            elif item_type == \"audio_url\":\n                marker = f\"<|sglang_dots_video_{video_index}_audio_{len(media)}|>\"\n                media[marker] = (Modality.AUDIO, item[\"audio_url\"][\"url\"])\n                rendered.append(marker)\n            else:\n                raise ValueError(f\"Unsupported preprocessed video item: {item_type}\")\n\n        expanded = \"\".join(rendered)\n        # The adapter appends the question to every flattened video. Keep the\n        # question already rendered by the chat template so multiple videos do\n        # not duplicate it.\n        if question:\n            question_pos = expanded.rfind(question)\n            if question_pos >= 0:\n                expanded = (\n                    expanded[:question_pos] + expanded[question_pos + len(question) :]\n                )\n\n        placeholder = self.video_placeholder_regex.search(input_text)\n        if placeholder is not None:\n            input_text = (\n                input_text[: placeholder.start()]\n                + expanded\n                + input_text[placeholder.end() :]","sourceCodeStart":255,"sourceCodeEnd":291,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/srt/multimodal/processors/dots_note_omni.py#L255-L291","documentation":"Raised by _render_video_content when iterating the preprocessed video content items (from the model's HF preprocessor) and encountering an item whose 'type' is neither one of the known types (image marker, audio_url, etc.). It signals a version/content mismatch between the bundled video preprocessor output and the processor's renderer.","triggerScenarios":"The dots_note_omni_video_core preprocessor emits content dicts with an unexpected 'type' key (e.g. new item kinds after a HF transformers version change), and _render_video_content hits the final else branch.","commonSituations":"Upgrading transformers or the model repo changes the video preprocessing output schema; the pinned sglang renderer only knows image/audio_url items. Reproduce with any video request through process_mm_data_async.","solutions":["Pin the transformers / model repo versions the Dots Note Omni processor was built against","Check the item['type'] value in the traceback and update/extend _render_video_content in dots_note_omni.py to handle it","Retry with the bundled test video (process_sample_video path) to isolate repo-vs-code drift"],"exampleFix":"// before\nelif item_type == \"audio_url\": ...\nelse: raise ValueError(...)\n// after (extend renderer for the new type)\nelif item_type == \"video_url\":\n    marker = f\"<|sglang_dots_video_{video_index}_url|>\"; media[marker] = (Modality.VIDEO, item[\"video_url\"][\"url\"]); rendered.append(marker)","handlingStrategy":"try-catch","validationCode":"ALLOWED = {'image', 'audio_url'}  # adapt to renderer's known types\nassert all(item.get('type') in ALLOWED for item in content), 'unsupported item type in preprocessed content'","typeGuard":null,"tryCatchPattern":"try:\n    out = await processor.process_mm_data_async(...)\nexcept ValueError as e:\n    if 'Unsupported preprocessed video item' in str(e):\n        # pin/rollback transformers or model repo; inspect item type in logs\n        raise RuntimeError(f'preprocessor/renderer version drift: {e}') from e\n    raise","preventionTips":["Pin transformers and the model repo versions","Watch release notes for dots preprocessor schema changes"],"tags":["multimodal","video","schema-mismatch","version-drift"],"backgroundTag":"schema-validation-failed","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}