sgl-project/sglang · error · ValueError

{path} allows at most {profile.max_condition_count} entries

Error message

{path} allows at most {profile.max_condition_count} entries for task {profile.task!r}

What it means

The task profile sets max_condition_count and more entries were supplied than allowed.

Source

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

            )
        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):
        cpath = f"{path}[{index}]"
        if not isinstance(cond, Mapping):
            raise ValueError(f"{cpath} must be an object")
        unknown = set(cond) - _ALLOWED_CONDITION_KEYS
        if unknown:
            raise ValueError(f"{cpath} has unknown fields: {sorted(unknown)}")
        role = _require_str(cond.get("role"), f"{cpath}.role")
        if role not in (

View on GitHub (pinned to 0132848349)

Solutions

  1. Trim conditions to max_condition_count
  2. Enforce the cap in the client before submission

Example fix

// before
conditions = all_frames  # 10 entries
// after
conditions = all_frames[:profile.max_condition_count]
Defensive patterns

Strategy: validation

Validate before calling

if profile.max_condition_count is not None:
    conditions = conditions[:profile.max_condition_count]

Prevention

When it happens

Trigger: Sending 5 keyframes to a task capped at, say, 2 conditions.

Common situations: Batch-generating per-frame conditions without trimming; UI letting users attach unlimited references.

Related errors


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