sgl-project/sglang · error · ValueError

tasks must contain canonical task names, got {task!r}

Error message

tasks must contain canonical task names, got {task!r}

What it means

Every task listed in the release metadata must already be in canonical form: canonical_minimax_h3_task(task) must be a fixed point. If a task is an alias or unknown spelling (canonicalization would change it), from_model_index rejects it — tasks must be canonical names, aliases belong in task_aliases.

Source

Thrown at python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/release_metadata.py:103

        try:
            video_sigma = float(scales["video"])
            audio_sigma = float(scales["audio"])
        except (KeyError, TypeError, ValueError) as exc:
            raise ValueError(
                "model_index.json._minimax_h3.sigma_shift_scales requires numeric "
                "video and audio values"
            ) from exc
        metadata = cls(
            schema_version=1,
            partition=partition,
            tasks=tasks,
            task_aliases=dict(aliases),
            video_sigma_shift=video_sigma,
            audio_sigma_shift=audio_sigma,
        )
        for task in metadata.tasks:
            if canonical_minimax_h3_task(task) != task:
                raise ValueError(
                    f"tasks must contain canonical task names, got {task!r}"
                )
            if partition_for_task(task) != partition:
                raise ValueError(
                    f"task {task!r} does not belong to partition {partition!r}"
                )
        for alias, target in metadata.task_aliases.items():
            if target not in metadata.tasks:
                raise ValueError(
                    f"task alias {alias!r} targets undeclared task {target!r}"
                )
            if canonical_minimax_h3_task(alias) != target:
                raise ValueError(
                    f"unsupported task alias mapping {alias!r} -> {target!r}"
                )
        return metadata

    @property

View on GitHub (pinned to 0132848349)

Solutions

  1. Replace each entry in tasks with its canonical task name from canonical_minimax_h3_task
  2. Move shorthand spellings into task_aliases mapping them to the canonical task
  3. Regenerate metadata from the canonical task table instead of hand-writing it

Example fix

// before
"tasks": ["t2v"]
// after
"tasks": ["text_to_video"], "task_aliases": {"t2v": "text_to_video"}
Defensive patterns

Strategy: validation

Validate before calling

from sglang... import canonical_minimax_h3_task
assert all(canonical_minimax_h3_task(t) == t for t in tasks), "non-canonical task in tasks"

Type guard

def all_canonical(tasks: list[str]) -> bool:
    return all(canonical_minimax_h3_task(t) == t for t in tasks)

Prevention

When it happens

Trigger: Declaring tasks: ["t2v"] in _minimax_h3 metadata where the canonical name is e.g. "text_to_video", so canonical_minimax_h3_task("t2v") != "t2v".

Common situations: Copy-pasting shorthand/alias names into the tasks list instead of canonical names, or mixing alias and canonical vocabularies when authoring the index.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


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