From 2c694e2b2b76ea9a5b30dbd979731ba92cb1e3ba Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Sat, 21 Feb 2026 20:42:43 +0300 Subject: Enha: add (loaded) suffix if model is loaded --- popups.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'popups.go') diff --git a/popups.go b/popups.go index b0ee4ae..e5c46a1 100644 --- a/popups.go +++ b/popups.go @@ -17,9 +17,13 @@ func showModelSelectionPopup() { } else if strings.Contains(api, "openrouter.ai") { return ORFreeModels } - // Assume local llama.cpp - updateModelLists() - return LocalModels + // Assume local llama.cpp - fetch with load status + models, err := fetchLCPModelsWithLoadStatus() + if err != nil { + logger.Error("failed to fetch models with load status", "error", err) + return LocalModels + } + return models } // Get the current model list based on the API modelList := getModelListForAPI(cfg.CurrentAPI) @@ -57,8 +61,10 @@ func showModelSelectionPopup() { modelListWidget.SetCurrentItem(currentModelIndex) } modelListWidget.SetSelectedFunc(func(index int, mainText string, secondaryText string, shortcut rune) { + // Strip "(loaded)" suffix if present for local llama.cpp models + modelName := strings.TrimSuffix(mainText, " (loaded)") // Update the model in both chatBody and config - chatBody.Model = mainText + chatBody.Model = modelName cfg.CurrentModel = chatBody.Model // Remove the popup page pages.RemovePage("modelSelectionPopup") -- cgit v1.2.3