{"record":{"id":"b18ecb3707681262","repo":"sgl-project/sglang","slug":"path-duration-seconds-is-required","errorCode":null,"errorMessage":"{path}.duration_seconds is required","messagePattern":"(.+?)\\.duration_seconds is required","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":114,"sourceCode":"    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\n        # audio-condition presence is enforced after conditions validate.\n    out: dict[str, Any] = {\n        \"short_edge\": short_edge,\n        \"aspect_ratio\": aspect_ratio,\n    }\n    if has_duration:\n        duration = target[\"duration_seconds\"]\n        if isinstance(duration, bool) or not isinstance(duration, (int, float)):\n            raise ValueError(f\"{path}.duration_seconds must be a number\")\n        if duration <= 0:\n            raise ValueError(f\"{path}.duration_seconds must be positive\")\n        if not (\n            MINIMAX_H3_MIN_DURATION_SECONDS\n            <= float(duration)\n            <= MINIMAX_H3_MAX_DURATION_SECONDS\n        ):\n            raise ValueError(","sourceCodeStart":96,"sourceCodeEnd":132,"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#L96-L132","documentation":"target.duration_seconds is missing and the task profile cannot derive duration from an audio reference (duration_from_audio_reference is false). Text-to-video style tasks need an explicit output duration.","triggerScenarios":"Omitting duration_seconds entirely for a task where profile.duration_from_audio_reference is false and no default exists.","commonSituations":"Building a minimal request dict and forgetting duration; assuming the server has a default duration; migrating from an API that defaulted duration.","solutions":["Add target.duration_seconds (a positive number within the min/max bounds)","If the task supports it, attach an audio reference condition so duration is derived"],"exampleFix":"// before\n{\"short_edge\": 768, \"aspect_ratio\": \"16:9\"}\n// after\n{\"short_edge\": 768, \"aspect_ratio\": \"16:9\", \"duration_seconds\": 6}","handlingStrategy":"validation","validationCode":"if target.get('duration_seconds') is None and not profile.duration_from_audio_reference:\n    target['duration_seconds'] = 6  # sane default within bounds","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Make duration a required field in your request builder"],"tags":["minimax-h3","duration","required-field"],"backgroundTag":"missing-required-field","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}