{"record":{"id":"05334591f3d49965","repo":"sgl-project/sglang","slug":"unsupported-minimax-h3-audio-material-chain-mater","errorCode":null,"errorMessage":"unsupported MiniMax H3 audio material chain {material_chain!r}","messagePattern":"unsupported MiniMax H3 audio material chain (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/reference_encoding.py","lineNumber":244,"sourceCode":"    if max_duration_seconds is not None:\n        max_duration_seconds = float(max_duration_seconds)\n        if not math.isfinite(max_duration_seconds) or max_duration_seconds <= 0:\n            raise ValueError(\"reference audio duration bound must be positive\")\n    start_time_seconds = float(start_time_seconds)\n    if not math.isfinite(start_time_seconds) or start_time_seconds < 0:\n        raise ValueError(\"reference audio start time must be non-negative\")\n\n    if material_chain == \"audio\":\n        if source_sample_rate is None or int(source_sample_rate) <= 0:\n            raise ValueError(\"reference audio sample rate must be positive\")\n        source_rate = int(source_sample_rate)\n    elif material_chain in {\n        \"video.reference_preserve\",\n        \"video_audio.reference_preserve\",\n    }:\n        source_rate = 44100\n    else:\n        raise ValueError(\n            f\"unsupported MiniMax H3 audio material chain {material_chain!r}\"\n        )\n\n    command = [\n        \"ffmpeg\",\n        \"-v\",\n        \"error\",\n    ]\n    if start_time_seconds > 0:\n        command += [\"-ss\", f\"{start_time_seconds:.9g}\"]\n    command += [\n        \"-i\",\n        str(path),\n        \"-map\",\n        \"0:a:0\",\n        \"-vn\",\n        \"-ac\",\n        str(MINIMAX_H3_AUDIO_CHANNELS),","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/reference_encoding.py#L226-L262","documentation":"_load_waveform only accepts specific material chains: 'audio', 'video.reference_preserve', and 'video_audio.reference_preserve'. Any other chain string is rejected because the decoder does not know how to source audio for it.","triggerScenarios":"Passing a material_chain like 'image.reference_preserve', 'video', or a typo like 'audio.reference' to minimax_h3_encode_reference_audio_rows.","commonSituations":"New material types added without updating this allowlist, or a typo/rename of chain identifiers between versions.","solutions":["Use one of the exact supported strings: audio, video.reference_preserve, video_audio.reference_preserve","Check for the constant/enum defining chain names instead of raw strings","If you added a new chain, extend the elif set and the corresponding decode parameters"],"exampleFix":"// before\nminimax_h3_encode_reference_audio_rows(rows, material_chain=\"video\")\n\n// after\nminimax_h3_encode_reference_audio_rows(rows, material_chain=\"video.reference_preserve\", ...)","handlingStrategy":"type-guard","validationCode":"SUPPORTED = {\"audio\", \"video.reference_preserve\", \"video_audio.reference_preserve\"}\n\ndef chain_ok(chain) -> bool:\n    return chain in SUPPORTED","typeGuard":"def is_supported_chain(chain: str) -> bool:\n    return chain in {\"audio\", \"video.reference_preserve\", \"video_audio.reference_preserve\"}","tryCatchPattern":null,"preventionTips":["Centralize chain names in one enum/constants module","Add a unit test asserting your chain vocabulary matches the encoder's allowlist"],"tags":["minimax-h3","material-chain","unsupported-operation"],"backgroundTag":"unsupported-media-type","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}