{"record":{"id":"880779ef61c92dcf","repo":"sgl-project/sglang","slug":"action-policy-returned-no-output","errorCode":null,"errorMessage":"action policy returned no output","messagePattern":"action policy returned no output","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/entrypoints/action/protocol.py","lineNumber":424,"sourceCode":"            server_args,\n            sampling_params_cls,\n        )\n    raise ValueError(\n        f\"Action endpoint is not implemented for {sampling_params_cls.__name__}\"\n    )\n\n\nasync def infer_action(\n    payload: dict[str, Any],\n    server_args: ServerArgs,\n) -> dict[str, Any]:\n    sp = build_action_sampling_params(payload, server_args)\n    req = prepare_request(server_args, sp)\n    response = await async_scheduler_client.forward(req)\n    if getattr(response, \"error\", None):\n        raise RuntimeError(response.error)\n    if response.output is None:\n        raise RuntimeError(\"action policy returned no output\")\n    return response.output[0]\n\n\ndef action_generation_response(\n    output: dict[str, Any],\n    server_args: ServerArgs,\n    *,\n    preserve_numpy: bool = False,\n) -> dict[str, Any]:\n    actions = output[\"actions\"]\n    action_array = np.asarray(actions)\n    if any(size == 0 for size in action_array.shape):\n        raise ValueError(\n            \"action output dimensions must be non-zero, got \"\n            f\"{tuple(action_array.shape)}\"\n        )\n    if action_array.ndim == 2:\n        action_array = action_array[None]","sourceCodeStart":406,"sourceCodeEnd":442,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/entrypoints/action/protocol.py#L406-L442","documentation":"Raised by infer_action when the scheduler response completes without an error but `response.output` is None, i.e. the action policy produced no output for the request. This indicates an empty or truncated generation rather than a hard failure — the response object exists but has no action output to unpack (response.output[0]).","triggerScenarios":"Calling create_action_generation or run_action_msgpack_ws when the scheduler returns a successful response whose output field is None — e.g. empty batch, request filtered out server-side, or a policy that emitted no tokens/actions.","commonSituations":"Sending an empty batch of observations, degenerate sampling settings (e.g. max_new_tokens=0) that yield no output, scheduler edge cases where a request is acked but produces nothing.","solutions":["Verify the request payload (observations/prompts) is non-empty before calling infer_action","Check sampling params (horizon, max tokens) built by build_action_sampling_params are non-zero","Retry the request; if it persists, inspect scheduler logs to see why output was omitted","Guard callers to surface a user-friendly message when output is missing instead of crashing"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if not payload.get(\"observations\"):\n    raise HTTPException(400, \"observations must be non-empty\")","typeGuard":null,"tryCatchPattern":"try:\n    out = await infer_action(client, payload, server_args)\nexcept RuntimeError as e:\n    if \"no output\" in str(e):\n        return error_response(502, \"policy produced no output\")\n    raise","preventionTips":["Reject empty batches/observations at the API layer","Ensure sampling params request a non-zero horizon","Retry once — empty output can be transient"],"tags":["action-inference","empty-output","scheduler"],"backgroundTag":"empty-model-response","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}