{"record":{"id":"3c8b958773009a72","repo":"sgl-project/sglang","slug":"cosmos3-action-request-produced-no-action-tensor","errorCode":null,"errorMessage":"Cosmos3 action request produced no action tensor","messagePattern":"Cosmos3 action request produced no action tensor","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/cosmos3.py","lineNumber":1696,"sourceCode":"                )\n            self.log_info(f\"Action predictions shape: {tuple(action_pred.shape)}\")\n\n        action_domain_ids = batch.extra.get(\"action_domain_ids\")\n        action_domain_id = (\n            int(action_domain_ids[0].item()) if action_domain_ids is not None else None\n        )\n        action_metadata = {\n            \"action_mode\": getattr(batch.sampling_params, \"action_mode\", None),\n            \"action_domain_id\": action_domain_id,\n            \"action_raw_action_dim\": (\n                batch.extra.get(\"raw_action_dim\")\n                if getattr(batch, \"extra\", None)\n                else None\n            ),\n        }\n        if batch.data_type == DataType.ACTION:\n            if action_pred is None:\n                raise RuntimeError(\"Cosmos3 action request produced no action tensor\")\n            payload_actions = (\n                action_pred[0] if action_pred.shape[0] == 1 else action_pred\n            )\n            payload = {\n                \"request_id\": batch.request_id,\n                \"actions\": payload_actions.numpy(),\n                \"action_mode\": action_metadata[\"action_mode\"],\n                \"domain_id\": action_metadata[\"action_domain_id\"],\n                \"raw_action_dim\": action_metadata[\"action_raw_action_dim\"],\n                \"parameters\": {\n                    \"num_inference_steps\": batch.num_inference_steps,\n                    \"num_frames\": batch.num_frames,\n                },\n            }\n            return OutputBatch(\n                output=[payload],\n                action_pred=action_pred,\n                metrics=batch.metrics if hasattr(batch, \"metrics\") else None,","sourceCodeStart":1678,"sourceCodeEnd":1714,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/cosmos3.py#L1678-L1714","documentation":"After a Cosmos3 forward for a request whose data_type is DataType.ACTION, the predicted action tensor (action_pred) is None. This means the model loop never emitted an action sample (e.g. action denoising path silently skipped or a tensor-shape/branch bug), and the runtime raises rather than returning a malformed payload.","triggerScenarios":"batch.data_type == DataType.ACTION but forward's denoising/sampling loop produced no action tensor — e.g. the action scheduler branch was skipped, num_steps=0 for the action scheduler, or an upstream flag routed the request through the video-only path.","commonSituations":"Misconfigured pipeline_config action settings; a code path change where action generation is gated behind a flag that wasn't set; version regression after refactor of the unified forward.","solutions":["Check that the action scheduler actually ran: verify action sampling steps > 0 and the action branch of forward executed","Ensure request/action latents were prepared (_prepare_action_latents path) and data_type is set before forward","If it reproduces, capture a minimal request and report with scheduler config — this indicates an internal routing bug"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    result = stage.forward(batch)\nexcept RuntimeError as e:\n    if \"produced no action tensor\" in str(e):\n        logger.error(\"action routing bug for request %s; dumping scheduler config\", batch.request_id)\n        raise\n    raise","preventionTips":["Ensure DataType.ACTION requests set action latents and action scheduler steps > 0","Add integration tests covering the ACTION path to catch routing regressions","Pin known-good sglang versions for action generation"],"tags":["cosmos3","action-generation","runtime","internal-error"],"backgroundTag":"empty-model-output","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}