{"record":{"id":"c9c70fbfefe3b533","repo":"sgl-project/sglang","slug":"name-must-be-a-sequence","errorCode":null,"errorMessage":"{name} must be a sequence","messagePattern":"(.+?) must be a sequence","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/presentation.py","lineNumber":179,"sourceCode":"def _as_int_list(value: int | Sequence[int] | None, *, name: str) -> list[int]:\n    if value is None:\n        return []\n    if isinstance(value, int):\n        return [int(value)]\n    if not isinstance(value, Sequence) or isinstance(value, (str, bytes)):\n        raise ValueError(f\"{name} must be an int or a sequence of ints\")\n    return [int(item) for item in value]\n\n\ndef _as_nested_int_list(\n    value: Sequence[int] | Sequence[Sequence[int]] | None,\n    *,\n    name: str,\n) -> list[list[int]]:\n    if value is None:\n        return []\n    if not isinstance(value, Sequence) or isinstance(value, (str, bytes)):\n        raise ValueError(f\"{name} must be a sequence\")\n    if len(value) == 0:\n        return []\n    first = value[0]\n    if isinstance(first, Sequence) and not isinstance(first, (str, bytes)):\n        out: list[list[int]] = []\n        for group in value:\n            if not isinstance(group, Sequence) or isinstance(group, (str, bytes)):\n                raise ValueError(f\"{name} must not mix nested and flat entries\")\n            out.append([int(item) for item in group])\n        return out\n    return [[int(item) for item in value]]\n\n\ndef _as_nested_float_list(\n    value: Sequence[float] | Sequence[Sequence[float]] | None,\n    *,\n    name: str,\n) -> list[list[float]]:","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/presentation.py#L161-L197","documentation":"_as_nested_int_list normalizes video block token counts (flat list or nested per-video-reference lists); the top-level value must be a non-str/bytes Sequence.","triggerScenarios":"Passing video_block_token_counts as an int, float, str, dict, or None-like scalar instead of a list/tuple, e.g. video_block_token_counts=196 or \"[196]\".","commonSituations":"YAML/JSON configs deserializing to scalars or strings; passing a single int where a per-video list is expected; dict keyed by reference id instead of a positional list.","solutions":["Wrap the value in a list: [196] or [[196]] per reference","Parse config strings into actual lists before calling","Match the nesting to the number of video references"],"exampleFix":"// before\nvideo_block_token_counts=196\n// after\nvideo_block_token_counts=[[196]]","handlingStrategy":"type-guard","validationCode":"if not isinstance(video_block_token_counts, (list, tuple)) or isinstance(video_block_token_counts, (str, bytes)):\n    raise TypeError(\"video_block_token_counts must be a list\")","typeGuard":"def is_int_sequence(v) -> bool:\n    return isinstance(v, (list, tuple)) and not isinstance(v, (str, bytes))","tryCatchPattern":null,"preventionTips":["Always wrap per-video counts in lists","Parse YAML/JSON into real sequences, not scalar strings"],"tags":["minimax-h3","type-validation","video-presentation"],"backgroundTag":"type-validation-failed","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}