Show a loading Model picker on Video Gen and cache the model list - #5837
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.ModelSelectgains aloadingprop — the same<select>, with its options swapped for a disabledLoading models…placeholder andaria-busyset. The Model label stays put, so nothing below it jumps when the list arrives.client/src/lib/videoGenStatusCache.jsstores the model-shaping slice of the payload (models,defaultModel,systemMemoryGb) insessionStorage, so a revisit paints the real picker immediately while the probe revalidates behind it.connected,reason,missingPackages,pythonPath,byovRuntimes,runtimeare dropped rather than guarded — and the read is markedstale: 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/statusis 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 showsChecking…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-warningsclean on the changed files.a11yConventions,responsiveGridConventions,FableLoomStory.browser,ChiefOfStaff) reproduce identically on the base commit and are unrelated.Follow-ups filed
/video-gen/models(no python probe) so even a cold load doesn't wait, which would let the cache be deleted.