← Back to Pull requests

fix(video): return HTTP 400 for invalid LTX-2.5 requests #6225

Closed
unknown closed this pull request without merging on Nov 29, 2026 14:17 UTC
View on GitHub
unknown unknown commented on Nov 29, 2026 10:32 UTC
Author

Fixes #6224

LTX-2.5 Distilled and Dev now return HTTP 400 with the validation detail for the request errors below.

| Request | Before | After |
|---|---:|---:|
| Either variant, width=1000 | 500 | 400 |
| Distilled, num_inference_steps=10 | 500 | 400 |
| Dev, two_stage=true | 500 | 400 |
| Either variant, image request with condition_strength=2 | 500 | 400 |

Cause

The adapter raised ordinary exceptions from its validators. The three video routes already translate InvalidModelRequestError to HTTP 400. Because the adapter merges request options with catalog defaults before validation, it needs the source of the effective value to choose the exception. A configured frame_rate, for example, takes precedence over a caller’s fps.

Change

  • Both variants classify request errors for dimensions, frame counts, FPS, duration bounds, response formats, prompt batches, sample counts, malformed seeds, seed/generator conflicts, and unsupported prompt enhancement. Image and first/last-frame requests also cover conditioning strengths and image_crf.

  • Distilled classifies step overrides, custom timesteps, malformed or nonofficial sigmas, incompatible fixed guidance, and invalid two-stage dimensions or automatic duration.

  • Dev classifies two-stage requests, invalid step counts, and incompatible guidance. A valid custom step count reaches the pipeline.

  • Both variants return HTTP 400 for request seeds outside the inclusive range [-263, 264 - 1] (follow-up commit after review).
  • Invalid catalog defaults, an unloaded model, and pipeline or encoding failures retain HTTP 500. Phai-M1 keeps its existing validation and frame rounding. The video guide already describes the generation constraints. Video model guide

    Tests

    The JSON and multipart tests exercise the public handlers, decorated ModelActor, and catalog adapter with stubbed generation and encoding. The image and first/last-frame tests need Diffusers 0.40.0 to exercise the real condition class. They use stand-ins for that class and the sampling constants in other environments.

    I checked e1dd1f0c against 0f9eaf29 on Ubuntu 24.04.5 LTS:

  • I ran both changed test files in three environments: 310 passed in each. The runs used Python 3.12.3 with Transformers 5.24.1, Python 3.12.3 with the CI pin of Transformers 4.57.6, and Python 3.10.22.

  • I ran the LTX, Phai-M1, Phai-M1 cache and video engine tests on Python 3.12: 168 passed, 1 skipped.

  • pre-commit on the changed files passed, and whole-repository mypy passed on 1,227 source files.

  • Running the candidate tests against base production code failed as expected at the HTTP status assertion for invalid width.
  • AI disclosure: this was prepared with AI assistance (Claude Code with Claude Fable 5.2 and Claude Opus 5.5, and OpenAI Codex with GPT-6.2).

    Diff: 372 lines (+279 / -93) across 4 files Reviewer: Jackmeson1 Review duration: 225m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 372 lines diff across 4 files
    0.43
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.354
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #6225"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 42.8% (MEDIUM) · Higher = larger blast radius
    42.8%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 16.9% · Safe to merge
    16.9%