sgl-project/sglang · error · RuntimeError
action policy returned no output
Error message
action policy returned no output
What it means
generate_action got a successful (non-error) response from the scheduler but output_batch.output is None, meaning the action policy produced no output payload. This indicates an empty/aborted generation on the worker side rather than an explicitly reported error.
Source
Thrown at python/sglang/multimodal_gen/runtime/entrypoints/diffusion_generator.py:473
self.server_args.model_path,
server_args=self.server_args,
**sampling_params_kwargs,
)
if sampling_params.data_type != DataType.ACTION:
raise ValueError(
f"generate_action requires an ACTION pipeline, got {sampling_params.data_type}"
)
req = prepare_request(
server_args=self.server_args,
sampling_params=sampling_params,
external_trace_header=external_trace_header,
)
output_batch = self._send_to_scheduler_and_wait_for_response(req)
if output_batch.error:
raise RuntimeError(output_batch.error)
if output_batch.output is None:
raise RuntimeError("action policy returned no output")
return output_batch.output[0]
def _resolve_prompts(
self,
prompt: str | list[str] | None,
prompt_path: str | None = None,
) -> list[str]:
"""Collect prompts from the argument or from a prompt file."""
path = prompt_path or self.server_args.prompt_file_path
if path is not None:
if not os.path.exists(path):
raise FileNotFoundError(f"Prompt text file not found: {path}")
with open(path, encoding="utf-8") as f:
prompts = [line.strip() for line in f if line.strip()]
if not prompts:
raise ValueError(f"No prompts found in file: {path}")
logger.info("Found %d prompts in %s", len(prompts), path)
return promptsView on GitHub (pinned to 0132848349)
Solutions
- Log and inspect the full OutputBatch (output, output_file_paths, error) to see which fields are populated
- Verify the prompt/observation passed to generate_action is non-empty and well-formed
- Check scheduler logs for early-return/abort paths on this request
- Retry the call once — if it consistently returns None, file it as a pipeline bug with the batch dump
Defensive patterns
Strategy: fallback
Validate before calling
assert prompt and prompt.strip(), "observation/prompt must be non-empty"
Type guard
def is_valid_action_prompt(prompt) -> bool:
return isinstance(prompt, str) and bool(prompt.strip()) Try / catch
try:
action = generator.generate_action(prompt=obs)
except RuntimeError as e:
if "no output" in str(e):
action = default_action # fallback policy
else:
raise Prevention
- Never pass empty strings as observations
- Log the full OutputBatch fields when this fires to capture evidence for a bug report
When it happens
Trigger: generate_action() where the scheduler returns successfully but attaches no output — e.g. request aborted, empty batch, or a worker path that returns early without populating outputs.
Common situations: Empty or whitespace-only observation/prompt; request cancelled mid-flight; edge case in the action pipeline where no frames were generated.
Related errors
- action policy returned no output
- {output_batch.error}
- Expected {request_count} outputs, got {output_count} from sc
- Subclasses of BaseScheduler must define '{attr}' property
- denoising_strength must be positive
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/c75ae1ca5d870126.
Report an issue: GitHub.