{"record":{"id":"7b7edef3cc00c18f","repo":"sgl-project/sglang","slug":"path-aspect-ratio-must-be-auto-for-task-profi","errorCode":null,"errorMessage":"{path}.aspect_ratio must be \"auto\" for task {profile.task!r}, got {aspect_ratio!r}","messagePattern":"(.+?)\\.aspect_ratio must be \"auto\" for task (.+?), got (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/request_validation.py","lineNumber":97,"sourceCode":"\ndef _validate_target(target: Any, *, profile: MiniMaxH3TaskProfile) -> dict[str, Any]:\n    path = \"target\"\n    if not isinstance(target, Mapping):\n        raise ValueError(f\"{path} is required and must be an object\")\n    # The canonical target has a deliberately small projection.  Transport\n    # compatibility keys are ignored; only these three declared values are\n    # validated and emitted below.\n    short_edge = _require_int(target.get(\"short_edge\"), f\"{path}.short_edge\")\n    if short_edge <= 0:\n        raise ValueError(f\"{path}.short_edge must be positive, got {short_edge}\")\n    if short_edge != MINIMAX_H3_RECOMMENDED_SHORT_EDGE:\n        # Same guard the resolver applies. Without it the recommended value warns\n        # that it is \"outside the verified configuration\", naming itself as the\n        # verified one.\n        warn_unverified_short_edge(short_edge)\n    aspect_ratio = _require_str(target.get(\"aspect_ratio\"), f\"{path}.aspect_ratio\")\n    if profile.aspect_ratio_forced_auto and aspect_ratio != \"auto\":\n        raise ValueError(\n            f'{path}.aspect_ratio must be \"auto\" for task {profile.task!r}, '\n            f\"got {aspect_ratio!r}\"\n        )\n    has_duration = target.get(\"duration_seconds\") is not None\n    if (\n        profile.task in {MINIMAX_H3_TASK_T2VA, MINIMAX_H3_TASK_REF2VA}\n        and aspect_ratio != \"auto\"\n        and aspect_ratio not in MINIMAX_H3_FINITE_ASPECT_RATIOS\n    ):\n        raise ValueError(\n            f\"{path}.aspect_ratio for task {profile.task!r} must be 'auto' or \"\n            f\"one of {list(MINIMAX_H3_FINITE_ASPECT_RATIOS)!r}, got \"\n            f\"{aspect_ratio!r}\"\n        )\n    if not has_duration:\n        if not profile.duration_from_audio_reference:\n            raise ValueError(f\"{path}.duration_seconds is required\")\n        # ref2va: duration may derive from a reference audio; the","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/request_validation.py#L79-L115","documentation":"The task profile for this MiniMax-H3 request forces aspect_ratio to \"auto\" (profile.aspect_ratio_forced_auto), but the request supplied a different string. Only specific tasks (not the T2VA/REF2VA finite-ratio set) allow explicit aspect ratios; the forced-auto tasks must use 'auto'.","triggerScenarios":"Submitting a task whose profile sets aspect_ratio_forced_auto (e.g. an audio-driven variant) with aspect_ratio like \"16:9\" instead of \"auto\".","commonSituations":"Reusing a T2VA request body for a forced-auto task; hardcoding a default aspect ratio in a client SDK for all tasks.","solutions":["Set target.aspect_ratio to the literal string \"auto\" for this task","Check the task profile's aspect_ratio_forced_auto flag before populating the field"],"exampleFix":"// before\n{\"aspect_ratio\": \"16:9\"}\n// after\n{\"aspect_ratio\": \"auto\"}","handlingStrategy":"validation","validationCode":"if profile.aspect_ratio_forced_auto:\n    target['aspect_ratio'] = 'auto'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Centralize task-profile-driven request building","Never hardcode a ratio across all tasks"],"tags":["minimax-h3","aspect-ratio","validation"],"backgroundTag":"invalid-request-parameter","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}