{"record":{"id":"ba91eee4e2341da6","repo":"sgl-project/sglang","slug":"cosmos3-action-requests-require-domain-name-or-dom","errorCode":null,"errorMessage":"Cosmos3 action requests require domain_name or domain_id","messagePattern":"Cosmos3 action requests require domain_name or domain_id","errorType":"validation","errorClass":"ValueError","httpStatus":400,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/entrypoints/action/cosmos3.py","lineNumber":192,"sourceCode":"        raise ValueError(\"Cosmos3 policy input requires an observation image\")\n    if action_mode == \"inverse_dynamics\" and video_path is None:\n        raise ValueError(\"Cosmos3 inverse_dynamics input requires an observation video\")\n    if images and video_path is not None:\n        raise ValueError(\"Cosmos3 action requests accept either an image or a video\")\n    batch_size = len(images) if images else 1\n    max_batch_size = max(1, int(getattr(server_args, \"batching_max_size\", 1)))\n    if batch_size > max_batch_size:\n        raise ValueError(\n            f\"Cosmos3 action batch size {batch_size} exceeds \"\n            f\"--batching-max-size={max_batch_size}\"\n        )\n    image_path = None if not images else images[0] if batch_size == 1 else images\n\n    domain_id = options.get(\"domain_id\")\n    domain_name = options.get(\"domain_name\")\n    raw_action_dim = options.get(\"raw_action_dim\")\n    if domain_id is None and not domain_name:\n        raise ValueError(\"Cosmos3 action requests require domain_name or domain_id\")\n    if domain_id is not None and not domain_name and raw_action_dim is None:\n        raise ValueError(\"raw_action_dim is required when only domain_id is provided\")\n\n    prompt = observation.get(\"prompt\")\n    if prompt is None:\n        prompt = observation.get(\"task\", \"\")\n    if action_mode != \"policy\" and not isinstance(prompt, str):\n        raise ValueError(\"Cosmos3 inverse_dynamics prompt must be a string\")\n    prompt = _action_prompt(prompt, batch_size)\n    sampling_kwargs = {\n        \"request_id\": payload.get(\"request_id\") or payload.get(\"id\"),\n        \"prompt\": prompt,\n        \"image_path\": image_path,\n        \"video_path\": video_path,\n        \"action_mode\": action_mode,\n        \"domain_id\": domain_id,\n        \"domain_name\": domain_name,\n        \"raw_action_dim\": raw_action_dim,","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/entrypoints/action/cosmos3.py#L174-L210","documentation":"Cosmos3 action requests need a robot domain specification: either domain_name (looked up to a known domain) or domain_id (with raw_action_dim). If both are missing the endpoint cannot size the action space and rejects the request. The values are read from the merged parameters/observation options.","triggerScenarios":"POST /v1/actions with neither domain_name nor domain_id in parameters or observation.","commonSituations":"Minimal test payload omitting domain config; assuming the server has a default domain; renamed field (e.g. 'domain') not recognized.","solutions":["Add domain_name for your robot (e.g. 'franka') to parameters","Or supply domain_id plus raw_action_dim if using a custom domain"],"exampleFix":"# before\n{\"parameters\": {\"action_horizon\": 16}}\n# after\n{\"parameters\": {\"action_horizon\": 16, \"domain_name\": \"franka\"}}","handlingStrategy":"validation","validationCode":"assert params.get('domain_name') or params.get('domain_id'), 'domain_name or domain_id required'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always include domain_name in request templates","Centralize robot domain config per deployment"],"tags":["cosmos3","domain-config","missing-required-field"],"backgroundTag":"missing-required-parameter","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}