sgl-project/sglang · error · ValueError
allows at most entries for task
Error message
{path} allows at most {profile.max_condition_count} entries for task {profile.task!r} What it means
This task profile allows at most max_condition_count condition entries. Remove extra conditions.
Solutions
- Trim conditions to max_condition_count
- 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
- Cap the condition count in upload UIs
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.
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
- requires at least entries for task , got
- {cpath}: {exc}
- has unknown fields
- must be an object
- .role must be keyframe or reference, got
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/6be000fe51d6b0b8.
Report an issue: GitHub.
Appendix: 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)