summaryrefslogtreecommitdiff
path: root/tui.go
diff options
context:
space:
mode:
Diffstat (limited to 'tui.go')
-rw-r--r--tui.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/tui.go b/tui.go
index d3ce14e..4313d26 100644
--- a/tui.go
+++ b/tui.go
@@ -12,11 +12,14 @@ import (
"path"
"strconv"
"strings"
+ "sync"
"github.com/gdamore/tcell/v2"
"github.com/rivo/tview"
)
+var _ = sync.RWMutex{}
+
var (
app *tview.Application
pages *tview.Pages
@@ -988,11 +991,13 @@ func init() {
}
updateStatusLine()
} else {
+ localModelsMu.RLock()
if len(LocalModels) > 0 {
currentLocalModelIndex = (currentLocalModelIndex + 1) % len(LocalModels)
chatBody.Model = LocalModels[currentLocalModelIndex]
cfg.CurrentModel = chatBody.Model
}
+ localModelsMu.RUnlock()
updateStatusLine()
// // For non-OpenRouter APIs, use the old logic
// go func() {