{"record":{"id":"6be000fe51d6b0b8","repo":"sgl-project/sglang","slug":"path-allows-at-most-profile-max-condition-count","errorCode":null,"errorMessage":"{path} allows at most {profile.max_condition_count} entries for task {profile.task!r}","messagePattern":"(.+?) allows at most (.+?) entries for task (.+?)","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":176,"sourceCode":"            )\n        return []\n    if len(conditions) == 0:\n        raise ValueError(\n            f\"{path} requires at least one entry for task {profile.task!r}\"\n        )\n    if (\n        profile.min_condition_count is not None\n        and len(conditions) < profile.min_condition_count\n    ):\n        raise ValueError(\n            f\"{path} requires at least {profile.min_condition_count} entries \"\n            f\"for task {profile.task!r}, got {len(conditions)}\"\n        )\n    if (\n        profile.max_condition_count is not None\n        and len(conditions) > profile.max_condition_count\n    ):\n        raise ValueError(\n            f\"{path} allows at most {profile.max_condition_count} entries \"\n            f\"for task {profile.task!r}, got {len(conditions)}\"\n        )\n\n    aligned_frame_count = (\n        minimax_h3_align_frame_count(frame_count) if frame_count is not None else None\n    )\n    normalized: list[dict[str, Any]] = []\n    seen_frame_indices: dict[int, int] = {}\n    for index, cond in enumerate(conditions):\n        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 (","sourceCodeStart":158,"sourceCodeEnd":194,"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#L158-L194","documentation":"The task profile sets max_condition_count and more entries were supplied than allowed.","triggerScenarios":"Sending 5 keyframes to a task capped at, say, 2 conditions.","commonSituations":"Batch-generating per-frame conditions without trimming; UI letting users attach unlimited references.","solutions":["Trim conditions to max_condition_count","Enforce the cap in the client before submission"],"exampleFix":"// before\nconditions = all_frames  # 10 entries\n// after\nconditions = all_frames[:profile.max_condition_count]","handlingStrategy":"validation","validationCode":"if profile.max_condition_count is not None:\n    conditions = conditions[:profile.max_condition_count]","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Cap the condition count in upload UIs"],"tags":["minimax-h3","conditions","count-constraint"],"backgroundTag":"value-out-of-range","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}