{"record":{"id":"b16cb1be9e9ae70f","repo":"sgl-project/sglang","slug":"profile-task-resolvedplan-requires-one-or-two-or","errorCode":null,"errorMessage":"{profile.task} ResolvedPlan requires one or two ordered image/keyframe conditions with frame_index [0], [-1], or [0, -1], got {signatures!r}","messagePattern":"(.+?) ResolvedPlan requires one or two ordered image/keyframe conditions with frame_index \\[0\\], \\[-1\\], or \\[0, -1\\], got (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/resolved_plan.py","lineNumber":308,"sourceCode":"        signatures = (\n            [\n                (\n                    condition.get(\"type\"),\n                    condition.get(\"role\"),\n                    condition.get(\"frame_index\"),\n                )\n                for condition in keyframe_conditions\n            ]\n            if all(isinstance(condition, Mapping) for condition in keyframe_conditions)\n            else []\n        )\n        frame_signature = tuple(signature[2] for signature in signatures)\n        if (\n            not signatures\n            or any(signature[:2] != (\"image\", \"keyframe\") for signature in signatures)\n            or frame_signature not in MINIMAX_H3_FL2VA_KEYFRAME_SIGNATURES\n        ):\n            raise ValueError(\n                f\"{profile.task} ResolvedPlan requires one or two ordered \"\n                \"image/keyframe \"\n                \"conditions with frame_index [0], [-1], or [0, -1], got \"\n                f\"{signatures!r}\"\n            )\n    shape = _resolve_shape(\n        canonical[\"target\"],\n        geometry_source=profile.geometry_source,\n        auto_aspect_ratio=profile.auto_aspect_ratio,\n        auto_geometry_source=profile.auto_geometry_source,\n    )\n\n    materials: list[MiniMaxH3MaterialPlanItem] = []\n    visual_encode: list[int] = []\n    audio_encode: list[int] = []\n    keyframe_semantic_indices: list[int] = []\n    keyframe_pixel_indices: list[int] = []\n    seen_keyframe_pixel_indices: dict[int, int] = {}","sourceCodeStart":290,"sourceCodeEnd":326,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/resolved_plan.py#L290-L326","documentation":"For keyframe-conditioned MiniMax H3 tasks the ResolvedPlan requires the ordered condition list to be one or two ('image','keyframe',...) entries whose frame_index signature tuple is one of MINIMAX_H3_FL2VA_KEYFRAME_SIGNATURES: (0,), (-1,), or (0, -1). Any other ordering, count, condition type, or frame signature raises this ValueError.","triggerScenarios":"Passing zero keyframe conditions, a non-'image'/non-'keyframe' condition type among the first two conditions, or frame_index values like 1, -2, or (0, 1) that are not in the allowed signature set.","commonSituations":"Assuming arbitrary frame positions (e.g. mid-video frame 5) are allowed as anchors; reordering conditions so the first-frame condition comes after the last-frame one; adding a text condition in the first two slots.","solutions":["Restructure conditions to exactly one or two ordered image keyframe conditions with frame_index 0 and/or -1","Remove extra/unsupported conditions from the front of the list","Check MINIMAX_H3_FL2VA_KEYFRAME_SIGNATURES in the package to confirm the allowed tuples for your version"],"exampleFix":"# before\nconditions = [{\"role\":\"first\",\"type\":\"image\",\"frame_index\": 1}]\n# after\nconditions = [{\"role\":\"first\",\"type\":\"image\",\"frame_index\": 0}]","handlingStrategy":"validation","validationCode":"sigs = [c.get(\"frame_index\") for c in conditions[:2] if c.get(\"type\")==\"keyframe\"]\nassert tuple(sigs) in {(0,),(-1,),(0,-1)}","typeGuard":"def valid_keyframe_sig(conds) -> bool:\n    sig = tuple(c.get(\"frame_index\") for c in conds\n                if c.get(\"type\") == \"image\")\n    return sig in MINIMAX_H3_FL2VA_KEYFRAME_SIGNATURES","tryCatchPattern":null,"preventionTips":["Only use frame_index 0 and/or -1 as anchors","Keep keyframe conditions ordered first-frame then last-frame"],"tags":["minimax-h3","keyframe","frame-index","plan-validation"],"backgroundTag":"enum-value-invalid","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}