{"record":{"id":"0bcae99544031524","repo":"sgl-project/sglang","slug":"target-aspect-ratio-must-be-w-h-or-auto-got","errorCode":null,"errorMessage":"target.aspect_ratio must be 'W:H' or 'auto', got {value!r}","messagePattern":"target\\.aspect_ratio must be 'W:H' or 'auto', 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":82,"sourceCode":"class MiniMaxH3ResolvedPlan(msgspec.Struct, frozen=True):\n    task: str\n    prompt: str\n    seed: int | None\n    materials: tuple[MiniMaxH3MaterialPlanItem, ...]\n    encoders: dict\n    branches: tuple[dict, ...]\n    default_flow_shift: float\n    default_audio_flow_shift: float\n    flow_shift: float | None\n    audio_flow_shift: float | None\n    shape: dict\n    condition_mask: dict\n\n\ndef _parse_aspect_ratio(value: str) -> tuple[int, int]:\n    parts = value.split(\":\")\n    if len(parts) != 2:\n        raise ValueError(f\"target.aspect_ratio must be 'W:H' or 'auto', got {value!r}\")\n    try:\n        w, h = int(parts[0]), int(parts[1])\n    except ValueError as exc:\n        raise ValueError(\n            f\"target.aspect_ratio must be integer 'W:H', got {value!r}\"\n        ) from exc\n    if w <= 0 or h <= 0:\n        raise ValueError(\n            f\"target.aspect_ratio components must be positive, got {value!r}\"\n        )\n    return w, h\n\n\ndef _nearest_multiple(value: float, multiple: int) -> int:\n    return max(multiple, int(round(float(value) / multiple)) * multiple)\n\n\ndef _validate_base_short_edge(value: Any) -> int:","sourceCodeStart":64,"sourceCodeEnd":100,"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#L64-L100","documentation":"MiniMax-H3 parses target.aspect_ratio by splitting on ':' and expects exactly two parts ('W:H'). This error fires when the string has no colon, or more than one (e.g. 'auto', '16:9:2', '169').","triggerScenarios":"Calling minimax_h3_resolve_plan (via minimax_h3_plan_from_batch or directly) with a canonical whose target.aspect_ratio lacks exactly one ':' separator.","commonSituations":"Passing '16x9' or '169' instead of '16:9'; passing an empty string; assuming 'auto' is handled here (it is resolved earlier in _resolve_spatial).","solutions":["Format the ratio as 'W:H' with a single colon, e.g. '16:9'","Use target aspect_ratio handling at the request-validation layer for 'auto' rather than in the resolved plan"],"exampleFix":"// before\n\"aspect_ratio\":\"16x9\"\n// after\n\"aspect_ratio\":\"16:9\"","handlingStrategy":"validation","validationCode":"import re\ndef ratio_ok(v): return isinstance(v, str) and re.fullmatch(r\"\\d+:\\d+\", v) is not None","typeGuard":"def is_wh_ratio(v) -> bool:\n    import re\n    return isinstance(v, str) and bool(re.fullmatch(r\"[1-9]\\d*:[1-9]\\d*\", v))","tryCatchPattern":"null","preventionTips":["Use a single ':' separator; store ratios as canonical 'W:H' strings"],"tags":["minimax-h3","aspect-ratio","parsing","resolved-plan"],"backgroundTag":"invalid-format-string","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}