{"record":{"id":"ae15799ae9affa1d","repo":"sgl-project/sglang","slug":"keyframe-frame-indices-must-be-omitted-when-keyfra","errorCode":null,"errorMessage":"keyframe_frame_indices must be omitted when keyframe cond is not included","messagePattern":"keyframe_frame_indices must be omitted when keyframe cond is not included","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/packed_sequence.py","lineNumber":45,"sourceCode":"    MINIMAX_H3_FL2VA_KEYFRAME_SIGNATURES,\n)\n\n_INTERP = 32\n_T_GROUP = 5\n_FRAME_PER_TOKEN = (1, 4, 4, 4, 4)\n_FRAME_RESCALE = 5.0 / 3.0\n_PATCH_H = 2\n_PATCH_W = 2\n\n\ndef _keyframe_cond_frame_indices(\n    *,\n    include_keyframe_cond: bool,\n    keyframe_frame_indices: list[int] | tuple[int, ...] | None,\n) -> list[int]:\n    if not include_keyframe_cond:\n        if keyframe_frame_indices is not None:\n            raise ValueError(\n                \"keyframe_frame_indices must be omitted when keyframe cond is not included\"\n            )\n        return []\n    if keyframe_frame_indices is None:\n        raise ValueError(\"strict fl2va packed layout requires keyframe_frame_indices\")\n    if any(\n        isinstance(value, bool) or not isinstance(value, int)\n        for value in keyframe_frame_indices\n    ):\n        raise ValueError(\n            \"strict fl2va packed layout requires integer keyframe_frame_indices\"\n        )\n    out = list(keyframe_frame_indices)\n    if tuple(out) not in MINIMAX_H3_FL2VA_KEYFRAME_SIGNATURES:\n        raise ValueError(\n            \"strict fl2va packed layout requires keyframe_frame_indices in \"\n            f\"{MINIMAX_H3_FL2VA_KEYFRAME_SIGNATURES!r}, got {out!r}\"\n        )","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/packed_sequence.py#L27-L63","documentation":"The packed-sequence builder was called with include_keyframe_cond=False but keyframe_frame_indices was still supplied. The strict layout requires the two to agree.","triggerScenarios":"Calling minimax_h3_packed_sequence(..., include_keyframe_cond=False, keyframe_frame_indices=[0]) — indices present while keyframe conditioning is off.","commonSituations":"Config merging that defaults indices in regardless of mode; disabling keyframe cond late without clearing the indices setting.","solutions":["Pass keyframe_frame_indices=None whenever include_keyframe_cond=False","In config handling, derive indices from the include flag","Add a config lint rejecting the combination"],"exampleFix":"# before\nseq = minimax_h3_packed_sequence(..., include_keyframe_cond=False, keyframe_frame_indices=[0, 8])\n# after\nseq = minimax_h3_packed_sequence(..., include_keyframe_cond=False, keyframe_frame_indices=None)","handlingStrategy":"validation","validationCode":"if not include_keyframe_cond:\n    assert keyframe_frame_indices is None, 'indices must be omitted when cond disabled'","typeGuard":null,"tryCatchPattern":"except ValueError as e: drop indices and rebuild the sequence","preventionTips":["Derive indices from the include flag in config code"],"tags":["config-validation","minimax-h3","packed-sequence"],"backgroundTag":"conflicting-options","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}