{"record":{"id":"6bd6d951778b4450","repo":"sgl-project/sglang","slug":"task-self-task-r-does-not-allow-condition-role","errorCode":null,"errorMessage":"task {self.task!r} does not allow condition role={role!r} type={condition_type!r}","messagePattern":"task (.+?) does not allow condition role=(.+?) type=(.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/task_profiles.py","lineNumber":132,"sourceCode":"    # For ref2va video, target may omit duration_seconds\n    # when an audio reference is present — duration derives from the\n    # reference audio probe and is then checked against the shared 4-15s range.\n    duration_from_audio_reference: bool = False\n    # Some deployments keep video references disabled while retaining the\n    # routing rule for projection/contract compatibility.\n    video_reference_supported: bool = True\n    min_condition_count: int | None = None\n    max_condition_count: int | None = None\n    # Resolution policy for target.aspect_ratio=\"auto\".  A concrete ratio\n    # resolves immediately; None keeps geometry deferred to the named source.\n    auto_aspect_ratio: str | None = None\n    auto_geometry_source: str | None = None\n\n    def rule_for(self, *, role: str, condition_type: str) -> MiniMaxH3ConditionRule:\n        for rule in self.condition_rules:\n            if rule.role == role and rule.condition_type == condition_type:\n                return rule\n        raise ValueError(\n            f\"task {self.task!r} does not allow condition \"\n            f\"role={role!r} type={condition_type!r}\"\n        )\n\n\n_BASE_COMPONENTS = (\n    \"processor\",\n    \"text_encoder\",\n    \"tokenizer\",\n    \"transformer\",\n    \"video_vae\",\n    \"audio_vae\",\n)\n\n_BRANCHES = tuple(dict(branch) for branch in MINIMAX_H3_DEFAULT_BRANCHES)\nMINIMAX_H3_TASK_PROFILES: dict[str, MiniMaxH3TaskProfile] = {\n    MINIMAX_H3_TASK_T2VA: MiniMaxH3TaskProfile(\n        task=MINIMAX_H3_TASK_T2VA,","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/task_profiles.py#L114-L150","documentation":"MiniMaxH3TaskProfile.rule_for looks up a condition rule by (role, condition_type) pair within the task's declared condition_rules. If no rule matches, the task profile explicitly disallows that condition combination, and the ValueError names the task, role, and type. This is called during condition validation and plan resolution.","triggerScenarios":"Calling minimax_h3_resolve_plan (or _validate_conditions) with a condition whose role/condition_type pair isn't declared for the task, e.g. role='reference' type='video' on a t2va profile (text-only task), or a mismatched pairing like role='target' type='video' where only type='image' is declared.","commonSituations":"Sending an image or video condition to a t2va (text-to-video) request; mixing up role names ('source' vs 'target'); adding a new condition type without extending the task profile's condition_rules.","solutions":["Check the condition_rules on the task's MiniMaxH3TaskProfile to see allowed role/type pairs","Match the task to the conditions you send: t2va takes text only, fl2va takes keyframe images, ref2va takes a reference video","Fix the role or condition_type spelling in the request"],"exampleFix":"# before\nresolve_plan(task=\"t2va\", conditions=[Condition(role=\"target\", condition_type=\"image\", ...)])\n\n# after\nresolve_plan(task=\"fl2va\", conditions=[Condition(role=\"target\", condition_type=\"image\", ...)])","handlingStrategy":"validation","validationCode":"profile = minimax_h3_task_profile(task)\nallowed = {(r.role, r.condition_type) for r in profile.condition_rules}\nfor c in conditions:\n    if (c.role, c.condition_type) not in allowed:\n        raise ValueError(f\"task {task} disallows {c.role}/{c.condition_type}\")","typeGuard":"def condition_allowed(task: str, role: str, condition_type: str) -> bool:\n    profile = minimax_h3_task_profile(task)\n    return any(r.role == role and r.condition_type == condition_type for r in profile.condition_rules)","tryCatchPattern":"catch ValueError from minimax_h3_resolve_plan and re-raise with the task's allowed role/type table","preventionTips":["Drive request construction from the task profile's condition_rules","Add an integration test asserting each task accepts exactly its intended conditions"],"tags":["minimax-h3","condition-rules","task-profile","validation"],"backgroundTag":"schema-validation-failed","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}