{"record":{"id":"1450aacc6ef909fe","repo":"sgl-project/sglang","slug":"component-residency-must-use-component-mode-got","errorCode":null,"errorMessage":"Component residency must use COMPONENT=MODE, got {assignment!r}","messagePattern":"Component residency must use COMPONENT=MODE, got (.+?)","errorType":"validation","errorClass":"ComponentResidencyError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/managers/memory_managers/component_residency.py","lineNumber":73,"sourceCode":"    if assignments is None:\n        return None\n\n    if isinstance(assignments, Mapping):\n        entries = assignments.items()\n    else:\n        values = [assignments] if isinstance(assignments, str) else assignments\n        parsed_entries: list[tuple[str, str]] = []\n        for value in values:\n            if not isinstance(value, str):\n                raise ComponentResidencyError(\n                    f\"Invalid component residency assignment: {value!r}\"\n                )\n            for assignment in value.split(\",\"):\n                assignment = assignment.strip()\n                if not assignment:\n                    continue\n                if \"=\" not in assignment:\n                    raise ComponentResidencyError(\n                        \"Component residency must use COMPONENT=MODE, got \"\n                        f\"{assignment!r}\"\n                    )\n                selector, mode = assignment.split(\"=\", 1)\n                parsed_entries.append((selector, mode))\n        entries = parsed_entries\n\n    normalized: dict[str, str] = {}\n    for raw_selector, raw_mode in entries:\n        if not isinstance(raw_selector, str) or not isinstance(raw_mode, str):\n            raise ComponentResidencyError(\n                \"Invalid component residency assignment: \"\n                f\"{raw_selector!r}={raw_mode!r}\"\n            )\n        selector = raw_selector.strip().replace(\"-\", \"_\").lower()\n        mode = raw_mode.strip().replace(\"_\", \"-\").lower()\n        if not selector:\n            raise ComponentResidencyError(","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/managers/memory_managers/component_residency.py#L55-L91","documentation":"Each comma-separated assignment in a residency string must contain '=' separating the component selector from the mode. A bare token like 'vit' has no mode and raises ComponentResidencyError.","triggerScenarios":"A residency string such as \"vit\" or \"vit,unet=cpu\" — the first comma-separated token lacks '='.","commonSituations":"Passing just a component name intending a default mode; truncation from shell quoting; trailing stray tokens after a copy-paste.","solutions":["Write the full COMPONENT=MODE form, e.g. vit=cpu","Remove stray tokens lacking '='"],"exampleFix":"# before\n--component-residency vit\n# after\n--component-residency vit=cpu","handlingStrategy":"validation","validationCode":"for tok in s.split(\",\"):\n    tok = tok.strip()\n    if tok and \"=\" not in tok:\n        raise SystemExit(f\"assignment {tok!r} lacks '=MODE'\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always write the full COMPONENT=MODE form, even for a single component"],"tags":["config","component-residency","parsing"],"backgroundTag":"invalid-config-format","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}