{"record":{"id":"e9eeee50089c91e1","repo":"sgl-project/sglang","slug":"cpath-must-be-an-object","errorCode":null,"errorMessage":"{cpath} must be an object","messagePattern":"(.+?) must be an object","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":189,"sourceCode":"        )\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 (\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","sourceCodeStart":171,"sourceCodeEnd":207,"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#L171-L207","documentation":"An individual entry in the conditions list is not a Mapping/object — e.g. it is a string URI or a list.","triggerScenarios":"conditions: [\"ref.png\"] instead of [{\"role\": ..., \"uri\": \"ref.png\"}].","commonSituations":"Shorthand URI lists from internal tooling; mixed-format arrays after JSON round-trips.","solutions":["Make every list entry an object with role/type/uri fields","Validate each entry with an isinstance Mapping check client-side"],"exampleFix":"// before\n\"conditions\": [\"ref.png\"]\n// after\n\"conditions\": [{\"role\": \"reference\", \"type\": \"image\", \"uri\": \"ref.png\"}]","handlingStrategy":"type-guard","validationCode":"conditions = [c for c in conditions if isinstance(c, dict)]\nassert len(conditions) == len(original)","typeGuard":"def is_condition_object(v) -> bool:\n    return isinstance(v, dict)","tryCatchPattern":null,"preventionTips":["Reject raw URI strings in the client schema"],"tags":["minimax-h3","conditions","type-mismatch"],"backgroundTag":"type-validation-failed","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}