sgl-project/sglang · error · ValueError
task does not allow condition role= type=
Error message
task {self.task!r} does not allow condition role={role!r} type={condition_type!r} What it means
MiniMaxH3TaskProfile.rule_for looks up a condition rule by (role, condition_type) pair within the task's declared condition_rules. If no rule matches, the task profile explicitly disallows that condition combination, and the ValueError names the task, role, and type. This is called during condition validation and plan resolution.
Solutions
- Check the condition_rules on the task's MiniMaxH3TaskProfile to see allowed role/type pairs
- Match the task to the conditions you send: t2va takes text only, fl2va takes keyframe images, ref2va takes a reference video
- Fix the role or condition_type spelling in the request
Example fix
# before resolve_plan(task="t2va", conditions=[Condition(role="target", condition_type="image", ...)]) # after resolve_plan(task="fl2va", conditions=[Condition(role="target", condition_type="image", ...)])
Defensive patterns
Strategy: validation
Validate before calling
profile = minimax_h3_task_profile(task)
allowed = {(r.role, r.condition_type) for r in profile.condition_rules}
for c in conditions:
if (c.role, c.condition_type) not in allowed:
raise ValueError(f"task {task} disallows {c.role}/{c.condition_type}") Type guard
def condition_allowed(task: str, role: str, condition_type: str) -> bool:
profile = minimax_h3_task_profile(task)
return any(r.role == role and r.condition_type == condition_type for r in profile.condition_rules) Try / catch
catch ValueError from minimax_h3_resolve_plan and re-raise with the task's allowed role/type table
Prevention
- Drive request construction from the task profile's condition_rules
- Add an integration test asserting each task accepts exactly its intended conditions
When it happens
Trigger: Calling minimax_h3_resolve_plan (or _validate_conditions) with a condition whose role/condition_type pair isn't declared for the task, e.g. role='reference' type='video' on a t2va profile (text-only task), or a mismatched pairing like role='target' type='video' where only type='image' is declared.
Common situations: Sending an image or video condition to a t2va (text-to-video) request; mixing up role names ('source' vs 'target'); adding a new condition type without extending the task profile's condition_rules.
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
- attention_head_dim must be positive.
- condition URI must be a non-empty string
- video block token count must be positive
- video block token counts and timestamps must align
- ffn_hidden_size must be positive.
AI-assisted analysis of sgl-project/sglang@0132848349 (2026-08-28).
Data as JSON: /api/errors/6bd6d951778b4450.
Report an issue: GitHub.
Appendix: source
Thrown at python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/minimax_h3/task_profiles.py:132
# For ref2va video, target may omit duration_seconds
# when an audio reference is present — duration derives from the
# reference audio probe and is then checked against the shared 4-15s range.
duration_from_audio_reference: bool = False
# Some deployments keep video references disabled while retaining the
# routing rule for projection/contract compatibility.
video_reference_supported: bool = True
min_condition_count: int | None = None
max_condition_count: int | None = None
# Resolution policy for target.aspect_ratio="auto". A concrete ratio
# resolves immediately; None keeps geometry deferred to the named source.
auto_aspect_ratio: str | None = None
auto_geometry_source: str | None = None
def rule_for(self, *, role: str, condition_type: str) -> MiniMaxH3ConditionRule:
for rule in self.condition_rules:
if rule.role == role and rule.condition_type == condition_type:
return rule
raise ValueError(
f"task {self.task!r} does not allow condition "
f"role={role!r} type={condition_type!r}"
)
_BASE_COMPONENTS = (
"processor",
"text_encoder",
"tokenizer",
"transformer",
"video_vae",
"audio_vae",
)
_BRANCHES = tuple(dict(branch) for branch in MINIMAX_H3_DEFAULT_BRANCHES)
MINIMAX_H3_TASK_PROFILES: dict[str, MiniMaxH3TaskProfile] = {
MINIMAX_H3_TASK_T2VA: MiniMaxH3TaskProfile(
task=MINIMAX_H3_TASK_T2VA,View on GitHub (pinned to 0132848349)