{"record":{"id":"1bbf8688c8e3108f","repo":"sgl-project/sglang","slug":"minimax-h3-text-encoding-requires-an-ordered-keyfr","errorCode":null,"errorMessage":"MiniMax H3 text encoding requires an ordered keyframe signature in {MINIMAX_H3_FL2VA_KEYFRAME_SIGNATURES!r}, got {frame_indices!r}","messagePattern":"MiniMax H3 text encoding requires an ordered keyframe signature in (.+?), got (.+?)","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":263,"sourceCode":"        \"\"\"Encode the positive Qwen3VL presentation into layer-50 states.\n\n        MiniMax H3 only supports the CFG-distilled model path, so every task\n        emits exactly one positive embedding payload. ComponentManager owns\n        residency/offload, while every folded-TP rank enters the encoder\n        collectives and receives the same replicated hidden states.\n        \"\"\"\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(","sourceCodeStart":245,"sourceCodeEnd":281,"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#L245-L281","documentation":"For fl2va/ref2va tasks, the ordered tuple of frame_index values of 'image.target_canvas' materials must be one of the supported signatures in MINIMAX_H3_FL2VA_KEYFRAME_SIGNATURES (first-frame and first+last-frame layouts). Any other ordering or set of keyframes is rejected before encoding.","triggerScenarios":"_encode_from_plan sees plan.task in {'fl2va','ref2va'} with keyframe materials whose tuple of frame_index values is not in the allowed set — e.g. a mid-video frame (index 2), duplicate indices, or reversed ordering.","commonSituations":"Clients constructing plans by hand with arbitrary frame indices, upstream request parsing that maps user keyframes to wrong frame_index values, or format changes to keyframe signature constants.","solutions":["Constrain keyframe materials to the supported signatures: first frame only, or first+last frame in order","If building plans programmatically, derive frame_index from the allowed signature constants rather than user-supplied indices","Regenerate the plan through the canonical request builder"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"idx = tuple(m.frame_index for m in plan.materials if m.material_chain == \"image.target_canvas\")\nassert plan.task not in {\"fl2va\", \"ref2va\"} or not idx or idx in MINIMAX_H3_FL2VA_KEYFRAME_SIGNATURES, idx","typeGuard":"def valid_keyframe_signature(plan) -> bool:\n    if plan.task not in {\"fl2va\", \"ref2va\"}:\n        return True\n    idx = tuple(m.frame_index for m in plan.materials if m.material_chain == \"image.target_canvas\")\n    return not idx or idx in MINIMAX_H3_FL2VA_KEYFRAME_SIGNATURES","tryCatchPattern":null,"preventionTips":["Use only first-frame or first+last-frame keyframes","Build plans via the canonical request builder, never by hand"],"tags":["minimax-h3","keyframes","plan-validation","fl2va"],"backgroundTag":"schema-validation-failed","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}