Repository navigation
ui: don't reload a loading model on select, prefer it in pre-selection - #31326
Conversation
Assisted-by: Claude (Opus 5.5 Medium)
Assisted-by: Claude (Opus 5.5 Medium)
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
ServeurpersoCom
left a comment
There was a problem hiding this comment.
One small thing: isModelLoading() also returns true while this client is unloading a model, since unload() sets the same loadingStates flag, so a model being unloaded can be pre-selected as the loading one. Checking this._status.isOperationInProgress(modelId) && !this.isModelLoaded(modelId) would keep only loads, as the status stays LOADED until UNLOADED.
Assisted-by: Claude (Opus 5.5 Medium)
Thanks, works as expected now! |
ggml-org#31326) * ui: don't reload a loading model on select, prefer it in pre-selection Assisted-by: Claude (Opus 5.5 Medium) * ui: skip hidden models in automatic model selection Assisted-by: Claude (Opus 5.5 Medium) * ui: don't count a model being unloaded as loading Assisted-by: Claude (Opus 5.5 Medium) (cherry picked from commit b12b405)


Overview
Picking a model that is already loading no longer starts a second load, and a chat without a model of its own pre-selects the model that is loading. Automatic selection also stops picking models hidden from the selector.
Demo
Recorded at 3a8c7ad; click the preview for the full video.
Additional information
The demo doesn't cover hidden models.
Cause
status.load()skips loads this client already started, but not a model the server reports as loading (started from another tab, the manager, or before a reload), so picking it sent another load request.ui: falseby the server, not the ones hidden in the manager, so it could land on a model the selector doesn't list.What changed
modelsStore.isModelLoading()covers both the server'sloadingstatus and a load this client started.handleSelectinuse-models-selectoronly loads a model that is neither loaded nor loading.ensureFirstModelSelected()(new chat) tries a loading model right after the last reply's model, before loaded models, favorites and the first available model.getLoadingModelToPreselect()lets a chat without a model in its replies swap its selection for a loading model, unless the selection is loaded or loading itself. A new chat andselectModelFromLastAssistantResponse()(opening a chat) use it, and the chat form's fallback tries a loading model before a loaded one.getVisibleModels()also skips models hidden in the manager, and the chat form's fallback uses it instead of every model. A conversation whose replies name a hidden model still selects it.Testing
Demo script
Requirements
Claude (Opus 5.5 Medium)