{"record":{"id":"0d2bf6fcaea8c124","repo":"sgl-project/sglang","slug":"target-short-edge-must-be-an-integer-got-value-r","errorCode":null,"errorMessage":"target.short_edge must be an integer, got {value!r}","messagePattern":"target\\.short_edge must be an integer, got (.+?)","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":104,"sourceCode":"        raise ValueError(\n            f\"target.aspect_ratio must be integer 'W:H', got {value!r}\"\n        ) from exc\n    if w <= 0 or h <= 0:\n        raise ValueError(\n            f\"target.aspect_ratio components must be positive, got {value!r}\"\n        )\n    return w, h\n\n\ndef _nearest_multiple(value: float, multiple: int) -> int:\n    return max(multiple, int(round(float(value) / multiple)) * multiple)\n\n\ndef _validate_base_short_edge(value: Any) -> int:\n    try:\n        short_edge = int(value)\n    except (TypeError, ValueError) as exc:\n        raise ValueError(\n            f\"target.short_edge must be an integer, got {value!r}\"\n        ) from exc\n    if short_edge != value or short_edge <= 0:\n        raise ValueError(f\"target.short_edge must be a positive integer, got {value!r}\")\n    if short_edge != MINIMAX_H3_BASE_SHORT_EDGE:\n        warn_unverified_short_edge(short_edge)\n    return short_edge\n\n\ndef minimax_h3_resolve_spatial_shape(\n    *,\n    width: int | float,\n    height: int | float,\n    base_short_edge: int = MINIMAX_H3_BASE_SHORT_EDGE,\n) -> dict[str, Any]:\n    \"\"\"Resolve one display ratio with the ``adapt_shape_v1`` math.\n\n    This is the only implementation of adaptive target geometry. Callers may","sourceCodeStart":86,"sourceCodeEnd":122,"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#L86-L122","documentation":"base_short_edge passed to minimax_h3_resolve_spatial_shape must be convertible to int. This error fires when float()/int() conversion raises TypeError (None) or ValueError (non-numeric string) inside _validate_base_short_edge.","triggerScenarios":"Calling minimax_h3_resolve_spatial_shape with base_short_edge=None, 'large', or another non-numeric value.","commonSituations":"Forwarding an unvalidated config field or JSON value straight into the resolver; optional CLI arg defaulting to None when omitted.","solutions":["Pass an integer base short edge (nominally MINIMAX_H3_BASE_SHORT_EDGE)","Coerce or default the value at the config boundary before calling the resolver"],"exampleFix":"# before\nresolve_spatial_shape(base_short_edge=config.short_edge)  # None\n# after\nresolve_spatial_shape(base_short_edge=config.short_edge or MINIMAX_H3_BASE_SHORT_EDGE)","handlingStrategy":"validation","validationCode":"def edge_ok(v):\n    try: return int(v) == v and int(v) > 0\n    except (TypeError, ValueError): return False","typeGuard":"def is_valid_short_edge(v) -> bool:\n    try: return type(int(v)) is int and int(v) == v and int(v) > 0\n    except (TypeError, ValueError): return False","tryCatchPattern":"null","preventionTips":["Default optional config values to MINIMAX_H3_BASE_SHORT_EDGE"],"tags":["minimax-h3","short-edge","type-error","spatial"],"backgroundTag":"invalid-parameter-type","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}