sgl-project/sglang · error · ValueError

task is required for MiniMax H3; supported tasks: fl2va, ref

Error message

task is required for MiniMax H3; supported tasks: fl2va, ref2va, t2va

What it means

The MiniMax H3 video adapter requires an explicit task on every request; supported tasks are t2va, fl2va, ref2va. validate_task_gate is the first check run by validate_transport_options and validate_sampling_params, and it rejects requests where the task was not provided at all or is None.

Source

Thrown at python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/video_adapter.py:72

    strict_file_delivery = True
    model_specific_fields = frozenset(
        {
            "task",
            "conditions",
            "target",
            "audio_flow_shift",
            "audio_guidance_scale",
            "quality",
            "output_mode",
            "imgvid_cond_noise_aug_for_inference",
            "audio_cond_noise_aug_for_inference",
        }
    )
    supported_tasks = frozenset({"t2va", "fl2va", "ref2va"})

    def validate_task_gate(self, task: Any, *, provided: bool) -> None:
        if not provided or task is None:
            raise ValueError(
                "task is required for MiniMax H3; supported tasks: "
                "fl2va, ref2va, t2va"
            )
        if not isinstance(task, str):
            raise ValueError("task must be a non-empty string for MiniMax H3")
        if not task.strip():
            raise ValueError("task must be a non-empty string for MiniMax H3")
        if task not in self.supported_tasks:
            raise ValueError(
                f"unsupported MiniMax H3 task {task!r}; supported tasks: "
                "fl2va, ref2va, t2va"
            )

    @staticmethod
    def _positive_finite_extra(
        request: VideoGenerationsRequest,
        name: str,
    ) -> float | None:

View on GitHub (pinned to 0132848349)

Solutions

  1. Always pass an explicit task string: 't2va', 'fl2va', or 'ref2va'
  2. Verify your transport layer forwards the task field intact
  3. Upgrade the client SDK to the version matching the server's expected request schema

Example fix

# before
response = client.generate(prompt="a cat", task=None)

# after
response = client.generate(prompt="a cat", task="t2va")
Defensive patterns

Strategy: validation

Validate before calling

task = request.get("task")
if task is None:
    raise ValueError("task is required; use t2va, fl2va, or ref2va")
adapter.validate_task_gate(task, provided=task is not None)

Type guard

def has_task(request: dict) -> bool:
    return request.get("task") is not None

Try / catch

catch ValueError from validate_sampling_params/validate_transport_options and map 'task is required' to a 400 response naming the supported tasks

Prevention

When it happens

Trigger: Submitting a generation request without the task parameter (provided=False), or with task=None; also when the transport layer drops the task field before validation runs.

Common situations: Clients omitting task assuming a default like t2v; a proxy/gateway stripping unknown fields including 'task'; SDK version mismatch where the task field moved to a different key (e.g. 'mode').

Understand the failure class

Background: Missing required parameter errors: what 'X is required' and 'the required X param is missing' mean, and how to fix them — this error's family across 27 libraries.

Related errors


AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28). Data as JSON: /api/errors/5122cdccc6b149e6. Report an issue: GitHub.