{"record":{"id":"4d76d851b2dd996e","repo":"sgl-project/sglang","slug":"task-plan-task-r-cannot-carry-image-target-canva","errorCode":null,"errorMessage":"task {plan.task!r} cannot carry image.target_canvas materials","messagePattern":"task (.+?) cannot carry image\\.target_canvas materials","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/stages/text_encoding.py","lineNumber":269,"sourceCode":"        \"\"\"\n        from sglang.multimodal_gen.runtime.pipelines_core.stages.model_specific_stages.minimax_h3.presentation import (\n            minimax_h3_text_only_ids,\n        )\n\n        prompt = plan.prompt\n        keyframes = [\n            m for m in plan.materials if m.material_chain == \"image.target_canvas\"\n        ]\n        if plan.task in {\"fl2va\", \"ref2va\"} and keyframes:\n            frame_indices = tuple(material.frame_index for material in keyframes)\n            if frame_indices not in MINIMAX_H3_FL2VA_KEYFRAME_SIGNATURES:\n                raise ValueError(\n                    \"MiniMax H3 text encoding requires an ordered keyframe signature \"\n                    f\"in {MINIMAX_H3_FL2VA_KEYFRAME_SIGNATURES!r}, got \"\n                    f\"{frame_indices!r}\"\n                )\n        elif keyframes:\n            raise ValueError(\n                f\"task {plan.task!r} cannot carry image.target_canvas materials\"\n            )\n        if MINIMAX_H3_TEXT_EMBEDDINGS_EXTRA_KEY in batch.extra:\n            return\n        if self.text_encoder is None:\n            raise ValueError(\n                \"MiniMaxH3TextEncodingStage direct encode requires a text_encoder \"\n                \"component\"\n            )\n        encode_ids = getattr(self.text_encoder, \"encode_ids\", None)\n        if not callable(encode_ids):\n            raise TypeError(\n                \"MiniMax H3 text_encoder component must expose callable \"\n                \"encode_ids(...) for direct encode (MiniMaxH3Qwen3VLEncoder)\"\n            )\n        if self.tokenizer is None:\n            raise ValueError(\n                \"MiniMaxH3TextEncodingStage direct encode requires a tokenizer component\"","sourceCodeStart":251,"sourceCodeEnd":287,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/stages/text_encoding.py#L251-L287","documentation":"image.target_canvas materials (keyframes) are only legal for fl2va/ref2va tasks. For any other plan.task carrying them, _encode_from_plan raises this ValueError, catching task/material mismatches before they reach the encoder.","triggerScenarios":"A plan whose task is e.g. 't2va' or any non-fl2va/ref2va value while plan.materials contains entries with material_chain == 'image.target_canvas'.","commonSituations":"Request builders attaching keyframe images to text-to-video requests, plan templates copied between tasks, or task field typos ('fl2va ' vs 'fl2va').","solutions":["Remove image.target_canvas materials from the plan or change plan.task to fl2va/ref2va so they are consistent","Validate the task/material combination in the request builder before submitting","Check for task string typos (exact match required)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"has_kf = any(m.material_chain == \"image.target_canvas\" for m in plan.materials)\nassert not has_kf or plan.task in {\"fl2va\", \"ref2va\"}, f\"task {plan.task} cannot carry keyframes\"","typeGuard":"def task_materials_consistent(plan) -> bool:\n    has_kf = any(m.material_chain == \"image.target_canvas\" for m in plan.materials)\n    return not has_kf or plan.task in {\"fl2va\", \"ref2va\"}","tryCatchPattern":null,"preventionTips":["Don't attach keyframe images to t2va requests","Double-check task strings for typos before submitting"],"tags":["minimax-h3","task-validation","materials","plan-validation"],"backgroundTag":"schema-validation-failed","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}