Five actionable findings from round 29 reviewer aggregate, plus an
origin/main merge that absorbs the chat_templates.py fix landed in
PR #5763. Skipped #4 / #5 (studio.txt + constraints.txt hub bump)
because CI evidence from round 26 contradicts that suggestion; the
real broken combo only happens via the --no-deps no-torch path
which is already bumped in no-torch-runtime.txt + pyproject.toml.
1. core/inference/diffusion.py: round 28 reordered
_release_chat_backend_for_diffusion BEFORE
_release_other_gpu_owners_for_diffusion to surface the helper /
advisor busy check early, but that meant the chat unload inside
_release_chat_backend_for_diffusion now fired before the
training / export conflict check in the second helper. A direct
backend caller (tests, scripts) or a route-precheck race with a
newly-started training run would then unload the user's chat and
then 409 with nothing loaded. Split the helper busy check into
_raise_if_helper_advisor_busy_for_diffusion (cheap, no side
effects), keep _release_chat_backend_for_diffusion as the
actual chat unload with an opt-out flag, and reorder load_model
to: (a) helper check, (b) training / export check + idle export
shutdown, (c) chat unload. All raises now fire BEFORE any
destructive unload.
2. Merge origin/main: absorbs af6504f9 (PR #5763
chat_templates.py find() guards + the new
tests/python/test_construct_chat_template_validation.py
regression test). Removes the 101-line stale-rebase silent
revert that round 29 reviewer 5 and 8 flagged.
3. frontend/src/features/images/images-page.tsx: supportsNegativePrompt
now also honours customFamily when no model is loaded yet, so a
Custom HF repo with family flux.2 / flux.2-klein correctly hides
the negative prompt field instead of silently sending it.
4. routes/inference.py /images/generate: report the ACTUAL PNG
width / height from PIL Image.size instead of echoing back the
requested payload values. FLUX-family pipelines round to
vae_scale_factor * 2, so a request for 520x520 lands as 512x512
internally; metadata now matches the bytes on the wire.
Tests: 98 targeted (diffusion + cached_gguf + inference_validation)
and frontend npm run typecheck pass locally.