sgl-project/sglang · error · ValueError

requires at least entries for task , got

Error message

{path} requires at least {profile.min_condition_count} entries for task {profile.task!r}, got {len(conditions)}

What it means

This task profile requires at least min_condition_count condition entries. Add more conditions.

Solutions

  1. Supply at least min_condition_count condition entries
  2. Check the task profile's min_condition_count and enforce it in the client UI

Example fix

// before
"conditions": [kf0]
// after
"conditions": [kf0, kf1]
Defensive patterns

Strategy: validation

Validate before calling

if profile.min_condition_count and len(conditions) < profile.min_condition_count:
    raise ValueError('too few conditions')

Prevention

When it happens

Trigger: Sending 1 condition to a task whose profile.min_condition_count is 2 or more.

Common situations: Multi-keyframe storyboard tasks where the client only uploads the first frame; partial upload failures silently dropping entries.

Understand the failure class

Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.

Related errors


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

Appendix: source

Thrown at python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/request_validation.py:168

    if not isinstance(conditions, Sequence) or isinstance(conditions, (str, bytes)):
        raise ValueError(f"{path} must be a list")

    if not profile.conditions_required:
        if len(conditions) > 0:
            raise ValueError(
                f"{path} must be empty for task {profile.task!r} "
                f"(got {len(conditions)} entries)"
            )
        return []
    if len(conditions) == 0:
        raise ValueError(
            f"{path} requires at least one entry for task {profile.task!r}"
        )
    if (
        profile.min_condition_count is not None
        and len(conditions) < profile.min_condition_count
    ):
        raise ValueError(
            f"{path} requires at least {profile.min_condition_count} entries "
            f"for task {profile.task!r}, got {len(conditions)}"
        )
    if (
        profile.max_condition_count is not None
        and len(conditions) > profile.max_condition_count
    ):
        raise ValueError(
            f"{path} allows at most {profile.max_condition_count} entries "
            f"for task {profile.task!r}, got {len(conditions)}"
        )

    aligned_frame_count = (
        minimax_h3_align_frame_count(frame_count) if frame_count is not None else None
    )
    normalized: list[dict[str, Any]] = []
    seen_frame_indices: dict[int, int] = {}
    for index, cond in enumerate(conditions):

View on GitHub (pinned to 0132848349)