{"record":{"id":"537516ea98161930","repo":"sgl-project/sglang","slug":"canonical-request-missing-key-r","errorCode":null,"errorMessage":"canonical request missing {key!r}","messagePattern":"canonical request missing (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/resolved_plan.py","lineNumber":277,"sourceCode":"    \"\"\"Canonical request (already validated) -> ResolvedPlan.\"\"\"\n    if not isinstance(canonical, Mapping):\n        raise ValueError(\"canonical request must be a mapping\")\n    allowed_keys = {\n        \"schema\",\n        \"task\",\n        \"prompt\",\n        \"conditions\",\n        \"target\",\n        \"seed\",\n        \"flow_shift\",\n        \"audio_flow_shift\",\n    }\n    unknown = set(canonical) - allowed_keys\n    if unknown:\n        raise ValueError(f\"canonical request has unknown fields: {sorted(unknown)}\")\n    for key in (\"schema\", \"task\", \"prompt\", \"conditions\", \"target\"):\n        if key not in canonical:\n            raise ValueError(f\"canonical request missing {key!r}\")\n    profile = minimax_h3_task_profile(str(canonical[\"task\"]))\n    conditions = canonical[\"conditions\"]\n    keyframe_conditions = (\n        [\n            condition\n            for condition in conditions\n            if isinstance(condition, Mapping) and condition.get(\"role\") == \"keyframe\"\n        ]\n        if isinstance(conditions, (list, tuple))\n        else []\n    )\n    if profile.task == \"fl2va\" or keyframe_conditions:\n        signatures = (\n            [\n                (\n                    condition.get(\"type\"),\n                    condition.get(\"role\"),\n                    condition.get(\"frame_index\"),","sourceCodeStart":259,"sourceCodeEnd":295,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/resolved_plan.py#L259-L295","documentation":"minimax_h3_resolve_plan validates the canonical request dict before building a ResolvedPlan and requires the keys 'schema', 'task', 'prompt', 'conditions', and 'target' to all be present. If any is absent, it raises ValueError telling you which key is missing. This is a fail-closed schema check so downstream stages never see a partial plan.","triggerScenarios":"Calling minimax_h3_resolve_plan / minimax_h3_plan_from_batch with a canonical dict that omitted one of the five required keys (e.g. forgot 'target' or 'conditions').","commonSituations":"Building a minimax_h3 canonical request by hand or transforming one from another format and dropping a field; upstream payload changes after a library upgrade that renamed/removed keys.","solutions":["Add the missing key reported in the message to the canonical request dict","Validate/serialize the request against the expected schema (the allowed key set enforced just above) before calling resolve","Regenerate the canonical request from the batch adapter instead of hand-writing it"],"exampleFix":"# before\nplan = minimax_h3_resolve_plan({\"schema\": \"minimax_h3\", \"task\": \"fl2va\", \"prompt\": \"...\", \"conditions\": []})\n# after\nplan = minimax_h3_resolve_plan({\"schema\": \"minimax_h3\", \"task\": \"fl2va\", \"prompt\": \"...\", \"conditions\": [], \"target\": {...}})","handlingStrategy":"validation","validationCode":"required = {\"schema\",\"task\",\"prompt\",\"conditions\",\"target\"}\nmissing = required - set(canonical)\nassert not missing, f\"missing {missing}\"","typeGuard":"def is_complete_canonical(c: Mapping) -> bool:\n    return set(c) >= {\"schema\",\"task\",\"prompt\",\"conditions\",\"target\"}","tryCatchPattern":null,"preventionTips":["Build canonical requests via the official batch adapter","Assert required keys before calling minimax_h3_resolve_plan"],"tags":["minimax-h3","schema-validation","required-field"],"backgroundTag":"schema-validation-failed","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}