Skip to content

Show a loading Model picker on Video Gen and cache the model list - #5837

Merged
atomantic merged 2 commits into
mainfrom
cos/task-mtjp224t/agent-b5a32c74
Sep 2, 2026
Merged

Show a loading Model picker on Video Gen and cache the model list#5837
atomantic merged 2 commits into
mainfrom
cos/task-mtjp224t/agent-b5a32c74

Conversation

@atomantic

Copy link
Copy Markdown
Owner

Summary

The Video Gen Model select is populated from GET /api/video-gen/status, which shells out to python and rebuilds the hardware-aware model list on every call. The field was hidden until that landed, so it popped into the middle of the form a second or two after the page rendered.

  • The field holds its place. ModelSelect gains a loading prop — the same <select>, with its options swapped for a disabled Loading models… placeholder and aria-busy set. The Model label stays put, so nothing below it jumps when the list arrives.
  • The list is cached per session. client/src/lib/videoGenStatusCache.js stores the model-shaping slice of the payload (models, defaultModel, systemMemoryGb) in sessionStorage, so a revisit paints the real picker immediately while the probe revalidates behind it.
  • The cache can't report python health. Only the whitelisted fields are stored — connected, reason, missingPackages, pythonPath, byovRuntimes, runtime are dropped rather than guarded — and the read is marked stale: true. The connectivity pill and the "install missing packages" banner wait for the live probe, so an interpreter the user just fixed (or broke) is never described from storage.

Session scope, not local: the model registry and the python environment both move with an upgrade or an install.

Test plan

  • client/src/pages/VideoGen.modelLoading.test.jsx (new, 3 cases): the field renders disabled with the placeholder while /status is in flight and becomes the real picker when it resolves; a second mount paints the cached list before the probe returns, and only the three model-shaping keys are persisted; a cached entry carrying a failed probe still shows Checking… with no install banner until the live probe lands.
  • client/src/pages/VideoGen* + client/src/components + client/src/lib/index.test.js: 448 files / 4962 tests pass.
  • biome lint --error-on-warnings clean on the changed files.
  • Four pre-existing suite failures on this repo (a11yConventions, responsiveGridConventions, FableLoomStory.browser, ChiefOfStaff) reproduce identically on the base commit and are unrelated.

Follow-ups filed

atomantic and others added 2 commits September 2, 2026 07:33
The model list arrives with GET /api/video-gen/status, which shells out to
python and rebuilds the hardware-aware list on every call. The Model field
was hidden until that landed, so it popped into the middle of the form a
second or two after the page rendered.

Keep the field and its label in place with a disabled "Loading models…"
placeholder (new `loading` prop on the shared ModelSelect), and cache the
last status payload in sessionStorage so a revisit paints the real list
immediately while the probe revalidates behind it. The cached copy is read
back marked stale and feeds only the model list and the model-shaping
numbers — python health, the connectivity pill, and the install banner all
keep waiting for the live probe.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fvz529qeJWUxgJQ1kg5bHT
Review follow-ups: collapse ModelSelect back to one <select> (the loading
state is now value/disabled/aria-busy on the existing element instead of a
second copy that ignored `disabled` and `emptyOption`), drop the unused
`loadingLabel` knob, and cache only the model-shaping fields — models,
defaultModel, systemMemoryGb — so python health is structurally absent from
storage rather than merely guarded on read. Name the field-visibility
condition instead of restating it, and trim the duplicated rationale.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fvz529qeJWUxgJQ1kg5bHT
@atomantic
atomantic merged commit ba161c7 into main Sep 2, 2026
7 checks passed
@atomantic
atomantic deleted the cos/task-mtjp224t/agent-b5a32c74 branch September 2, 2026 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant