{"record":{"id":"e66c64167a308a43","repo":"sgl-project/sglang","slug":"unknown-action-domain-name-domain-name-r-valid","errorCode":null,"errorMessage":"Unknown action domain name {domain_name!r}. Valid names: {sorted(EMBODIMENT_TO_DOMAIN_ID)}","messagePattern":"Unknown action domain name (.+?)\\. Valid names: (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/cosmos3.py","lineNumber":641,"sourceCode":"    def component_uses(\n        self, server_args: ServerArgs, stage_name: str | None = None\n    ) -> list[ComponentUse]:\n        return [ComponentUse(self._component_stage_name(stage_name), \"vae\")]\n\n    @staticmethod\n    def _resolve_domain_id(batch: Req) -> int:\n        \"\"\"Resolve action embodiment domain ID; required for action generation.\"\"\"\n        domain_id = getattr(batch.sampling_params, \"domain_id\", None)\n        if domain_id is not None:\n            domain_id = int(domain_id)\n            if domain_id < 0:\n                raise ValueError(f\"domain_id must be non-negative, got {domain_id}\")\n            return domain_id\n        domain_name = getattr(batch.sampling_params, \"domain_name\", None)\n        if domain_name:\n            key = str(domain_name).strip().lower()\n            if key not in EMBODIMENT_TO_DOMAIN_ID:\n                raise ValueError(\n                    f\"Unknown action domain name {domain_name!r}. \"\n                    f\"Valid names: {sorted(EMBODIMENT_TO_DOMAIN_ID)}\"\n                )\n            return EMBODIMENT_TO_DOMAIN_ID[key]\n        raise ValueError(\n            \"Cosmos3 action generation requires --domain-id or --domain-name.\"\n        )\n\n    def _prepare_action_latents(\n        self,\n        batch: Req,\n        generator,\n        device: torch.device,\n        dtype: torch.dtype,\n    ) -> None:\n        \"\"\"Prepare action latents and conditioning, writing them onto ``batch``.\n\n        Action tokens run at frame rate (no temporal compression), so the chunk","sourceCodeStart":623,"sourceCodeEnd":659,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/cosmos3.py#L623-L659","documentation":"When domain_name is given instead of domain_id, it is normalized (strip+lower) and looked up in the EMBODIMENT_TO_DOMAIN_ID registry. Unknown names are rejected with the list of valid names to prevent silent domain mismatches.","triggerScenarios":"Passing sampling_params.domain_name not present in EMBODIMENT_TO_DOMAIN_ID (e.g. 'Franka-ARM' if 'franka_arm' is the registered key, or a typo).","commonSituations":"Guessing embodiment names, casing/separator mismatches, or a new robot not yet in the registry.","solutions":["Use one of the valid names printed in the error (lowercase, exact spelling)","Check casing/underscores: the lookup strips and lowercases but does not fuzzy match","Fall back to the numeric domain_id if the name is unlisted"],"exampleFix":"# before\nsp.domain_name = 'Franka Arm'\n\n# after\nsp.domain_name = 'franka_arm'  # exact key from EMBODIMENT_TO_DOMAIN_ID","handlingStrategy":"validation","validationCode":"from sglang.multimodal_gen... import EMBODIMENT_TO_DOMAIN_ID\nkey = sp.domain_name.strip().lower()\nassert key in EMBODIMENT_TO_DOMAIN_ID, f'use one of {sorted(EMBODIMENT_TO_DOMAIN_ID)}'","typeGuard":"def known_domain_name(name: str, registry: dict) -> bool:\n    return name.strip().lower() in registry","tryCatchPattern":"try:\n    stage.forward(batch)\nexcept ValueError as e:\n    if 'Unknown action domain name' in str(e):\n        sp.domain_name = 'franka_arm'  # fallback to a known domain\n    else:\n        raise","preventionTips":["Expose the valid domain list to users via API docs/introspection","Normalize names (strip+lower) client-side before submitting"],"tags":["cosmos3","action-generation","domain-name","lookup","validation"],"backgroundTag":"unknown-key-lookup","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}