{"record":{"id":"176ff547e7bb0414","repo":"sgl-project/sglang","slug":"path-must-be-an-integer","errorCode":null,"errorMessage":"{path} must be an integer","messagePattern":"(.+?) must be an integer","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":54,"sourceCode":"    minimax_h3_align_frame_count,\n)\n\nMINIMAX_H3_REQUEST_SCHEMA = \"minimax_h3.request/v1\"\nMINIMAX_H3_MAX_SIGNED_SEED = (1 << 63) - 1\n_ALLOWED_CONDITION_KEYS = frozenset(\n    {\"type\", \"uri\", \"role\", \"frame_index\", \"start_time_seconds\"}\n)\n\n\ndef _require_str(value: Any, path: str) -> str:\n    if not isinstance(value, str) or value == \"\":\n        raise ValueError(f\"{path} must be a non-empty string\")\n    return value\n\n\ndef _require_int(value: Any, path: str) -> int:\n    if isinstance(value, bool) or not isinstance(value, int):\n        raise ValueError(f\"{path} must be an integer\")\n    return value\n\n\ndef _optional_positive_finite_float(value: Any, path: str) -> float | None:\n    if value is None:\n        return None\n    if isinstance(value, bool) or not isinstance(value, (int, float)):\n        raise ValueError(f\"{path} must be a number\")\n    normalized = float(value)\n    if not math.isfinite(normalized) or normalized <= 0.0:\n        raise ValueError(f\"{path} must be a positive finite number\")\n    return normalized\n\n\ndef _optional_nonnegative_finite_float(value: Any, path: str) -> float | None:\n    if value is None:\n        return None\n    if isinstance(value, bool) or not isinstance(value, (int, float)):","sourceCodeStart":36,"sourceCodeEnd":72,"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#L36-L72","documentation":"_require_int enforces integer fields (e.g. target.short_edge, condition frame_index) in the canonical request. Python bools are explicitly rejected even though bool subclasses int.","triggerScenarios":"Passing target.short_edge = \"512\", 512.0, None, or True to minimax_h3_validate_canonical_request.","commonSituations":"JSON numbers arriving as floats or numeric strings from loosely typed clients, or a boolean flag accidentally placed in an int field.","solutions":["Send a true JSON integer (no quotes, no decimal point) at the path named in the message","Convert with int(value) client-side after confirming it is integral","Never put booleans in numeric fields"],"exampleFix":"# before\n{\"short_edge\": \"512\"}\n# after\n{\"short_edge\": 512}","handlingStrategy":"type-guard","validationCode":"assert isinstance(v, int) and not isinstance(v, bool), f\"{path} must be an integer\"","typeGuard":"from numbers import Integral\ndef is_int(v: Any) -> bool:\n    return isinstance(v, Integral) and not isinstance(v, bool)","tryCatchPattern":null,"preventionTips":["Send JSON integers without quotes/decimals","Parse with parse_int enforcement or pydantic StrictInt"],"tags":["minimax-h3","request-validation","integer-field","type-check"],"backgroundTag":"schema-validation-failed","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}