{"record":{"id":"1cdf5d770b8cf4fd","repo":"sgl-project/sglang","slug":"cpath-exc","errorCode":null,"errorMessage":"{cpath}: {exc}","messagePattern":"\\{cpath\\}: \\{exc\\}","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":205,"sourceCode":"        cpath = f\"{path}[{index}]\"\n        if not isinstance(cond, Mapping):\n            raise ValueError(f\"{cpath} must be an object\")\n        unknown = set(cond) - _ALLOWED_CONDITION_KEYS\n        if unknown:\n            raise ValueError(f\"{cpath} has unknown fields: {sorted(unknown)}\")\n        role = _require_str(cond.get(\"role\"), f\"{cpath}.role\")\n        if role not in (\n            MINIMAX_H3_CONDITION_ROLE_KEYFRAME,\n            MINIMAX_H3_CONDITION_ROLE_REFERENCE,\n        ):\n            raise ValueError(\n                f\"{cpath}.role must be keyframe or reference, \" f\"got {role!r}\"\n            )\n        cond_type = _require_str(cond.get(\"type\"), f\"{cpath}.type\")\n        try:\n            rule = profile.rule_for(role=role, condition_type=cond_type)\n        except ValueError as exc:\n            raise ValueError(f\"{cpath}: {exc}\") from exc\n        uri = _require_str(cond.get(\"uri\"), f\"{cpath}.uri\")\n\n        entry: dict[str, Any] = {\"type\": cond_type, \"uri\": uri, \"role\": role}\n        if rule.requires_frame_index:\n            frame_index = _require_int(cond.get(\"frame_index\"), f\"{cpath}.frame_index\")\n            if aligned_frame_count is None:\n                raise ValueError(\n                    f\"{cpath}.frame_index requires a resolved target duration\"\n                )\n            if frame_index == -1:\n                resolved = aligned_frame_count - 1\n            elif 0 <= frame_index < aligned_frame_count:\n                resolved = frame_index\n            else:\n                raise ValueError(\n                    f\"{cpath}.frame_index must be -1 or in \"\n                    f\"[0, {aligned_frame_count}) after 17n+5 frame alignment, \"\n                    f\"got {frame_index}\"","sourceCodeStart":187,"sourceCodeEnd":223,"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#L187-L223","documentation":"The (role, type) pair has no matching rule in the task profile — profile.rule_for(role=..., condition_type=...) raised ValueError, which is re-raised with the conditions[i] path prefix. E.g. 'reference' + 'video' when the task only accepts image references.","triggerScenarios":"Sending type 'audio' for role 'keyframe', or any role/type combination the task doesn't support.","commonSituations":"Assuming all media types work for every role; task profiles differing in supported condition types.","solutions":["Use a (role, type) combination the task profile declares (e.g. keyframe+image, reference+image/video)","Inspect profile.rule_for / the task's rule table to see allowed pairs","Switch task if the needed conditioning type isn't supported"],"exampleFix":"// before\n{\"role\": \"keyframe\", \"type\": \"audio\", \"uri\": \"a.mp3\"}\n// after\n{\"role\": \"reference\", \"type\": \"audio\", \"uri\": \"a.mp3\"}","handlingStrategy":"try-catch","validationCode":"try:\n    profile.rule_for(role=cond['role'], condition_type=cond['type'])\nexcept ValueError:\n    raise ValueError('unsupported (role, type) for this task')","typeGuard":null,"tryCatchPattern":"try:\n    validate(req)\nexcept ValueError as e:\n    if 'conditions[' in str(e):\n        surface_to_user(e)  # per-entry condition errors are user-fixable\n    raise","preventionTips":["Consult the task's rule table before offering type choices per role"],"tags":["minimax-h3","conditions","role-type-mapping"],"backgroundTag":"value-not-in-allowed-set","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}