Skip to content

Serve the Video Gen model list off /video-gen/models instead of the python-probe /status payload #5835

Description

@atomantic

Problem

GET /api/video-gen/status welds three unrelated things into one response: python health (a subprocess probe, ~1–2s), the hardware-aware model list, and the model-shaping numbers (defaultModel, systemMemoryGb, fflfLtx2PixelBudget). The Video Gen page needs the model list to render its Model picker, so the picker waits on the python probe.

A first fix landed in client/src/pages/VideoGen.jsx + client/src/lib/videoGenStatusCache.js: the field now holds its place with a loading placeholder, and a session cache paints the previous model list immediately on a revisit. That covers the second-and-later loads, but a cold load (new tab / new session) still waits on the probe before any model appears.

GET /api/video-gen/models (server/routes/videoGen.js, router.get('/models')) already returns hardwareAwareVideoModels() with no python probe — and listVideoModels() in client/src/services/apiImageVideo.js already wraps it with the same hardware filter. The sibling ImageGen page is already shaped this way (listImageModels() from its own mount effect, separate from refreshStatus()), which is why it does not have this problem.

Work

  1. Add the model-shaping fields the picker's auto-select needs to the /video-gen/models response — defaultModel, systemMemoryGb, and fflfLtx2PixelBudget — either as a wrapper object (breaking the current bare-array shape, so version-gate it) or as a sibling GET /video-gen/model-context. Keep /status returning them too; other callers read them there.
  2. In VideoGen.jsx, fetch that alongside getVideoGenStatus() on mount and let it drive models + the auto-select inputs. /status keeps owning connectivity only.
  3. Once the model list no longer rides the probe, re-evaluate client/src/lib/videoGenStatusCache.js: if the decoupled fetch is fast enough that the picker paints immediately, delete the cache, its barrel/README rows, the stale flag and the statusFresh gate in VideoGen.jsx, and the two cache-specific cases in client/src/pages/VideoGen.modelLoading.test.jsx. Keep the loading-placeholder case either way.

Decisions already made

  • Do NOT cache resolveLocalPythonHealth server-side. The route comment states the invariant: it probes package imports on every call so a half-installed python cannot masquerade as connected.
  • Keep the loading prop on client/src/components/ModelSelect.jsx regardless — a slow list is a property of the shared picker, and the placeholder is what keeps the form from jumping.

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort:mediumEffort: mediummodel:mediumModel size: mediumplanTracked by /do:replanplanner:opus-5Plan authored by the opus-5 modeluxProposed from a UX/design audit

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions