Skip to content

[Manual Test] diffusion endpoints allow model mismatch (upstream #2805)#20

Closed
lishunyang12 wants to merge 1 commit into
mainfrom
manual-test-3tier
Closed

[Manual Test] diffusion endpoints allow model mismatch (upstream #2805)#20
lishunyang12 wants to merge 1 commit into
mainfrom
manual-test-3tier

Conversation

@lishunyang12
Copy link
Copy Markdown
Owner

Manual test of the 3-tier model routing.

How to use

Apply one of these labels to kick off a review:

Label Model When
claude-review Opus 4.7 Deep review
claude-quick Haiku 4.5 Fast LGTM-style triage

Then in comments, talk to the reviewer:

  • @claude review — full review (Sonnet)
  • @claude why did you flag X? — question (Sonnet)
  • @claude I disagree — Y handles that — disagreement (Sonnet)
  • @claude LGTM? — short verdict (Sonnet)
  • @claude look again after my fix — re-review (Sonnet)

Good comparison experiment

  1. Apply claude-quick first → Haiku does a fast scan
  2. Then apply claude-review → Opus does a deep pass
  3. Compare the two results

Mirrors upstream vllm-project#2805 ([Bugfix] diffusion endpoints allow model mismatch — 3 files / 61 lines). Do not merge.

Signed-off-by: xiaohajiayou <923390377@qq.com>
@lishunyang12
Copy link
Copy Markdown
Owner Author

@claude review

@claude
Copy link
Copy Markdown

claude Bot commented Apr 16, 2026

LGTM

@@ -2136,10 +2136,12 @@ async def _parse_video_form(
app_model_name, app_stage_configs = _resolve_video_runtime_context(raw_request)
effective_model_name = handler.model_name or app_model_name or request.model or "unknown"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The or request.model fallback silently defeats the new hard-error guard. When both handler.model_name and app_model_name are None (which is possible if OmniOpenAIServingVideo was constructed via __init__ with the default model_name=None, e.g. not via for_diffusion), effective_model_name becomes request.model and the check request.model != effective_model_name is always False — no 400 is ever raised.

The image endpoints don't have this hole: _get_engine_and_model uses "unknown" as the fallback, not the client's model string.

If the intent is a hard reject on mismatch, pull the model name directly from the handler/app and error explicitly when it's unset, rather than falling back to what the client sent:

Suggested change
effective_model_name = handler.model_name or app_model_name or request.model or "unknown"
effective_model_name = handler.model_name or app_model_name
if effective_model_name is None:
raise HTTPException(
status_code=HTTPStatus.SERVICE_UNAVAILABLE.value,
detail="Server model name is not configured.",
)

Then keep the existing mismatch check below unchanged.

@lishunyang12 lishunyang12 added the claude-review Trigger Claude review in alex-jw-brooks style (Sonnet 4.6). label Apr 16, 2026
Comment on lines 2137 to 2138
effective_model_name = handler.model_name or app_model_name or request.model or "unknown"
if request.model is not None and effective_model_name is not None and request.model != effective_model_name:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The or request.model or "unknown" fallback defeats the validation. When both handler.model_name and app_model_name are None, effective_model_name falls through to request.model, so request.model != effective_model_name is always False — the 400 below can never fire. The image endpoints don't have this hole because they compare directly against model_name from _get_engine_and_model.

Suggested change
effective_model_name = handler.model_name or app_model_name or request.model or "unknown"
if request.model is not None and effective_model_name is not None and request.model != effective_model_name:
effective_model_name = handler.model_name or app_model_name
if request.model is not None and effective_model_name is not None and request.model != effective_model_name:

@lishunyang12
Copy link
Copy Markdown
Owner Author

Closing — superseded by label-only config change (no @claude, 3 tiers).

@lishunyang12 lishunyang12 deleted the manual-test-3tier branch April 16, 2026 19:10
@claude
Copy link
Copy Markdown

claude Bot commented Apr 16, 2026

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claude-review Trigger Claude review in alex-jw-brooks style (Sonnet 4.6).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants