summaryrefslogtreecommitdiff
path: root/bot.go
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2026-03-08 06:45:51 +0300
committerGrail Finder <wohilas@gmail.com>2026-03-08 06:45:51 +0300
commit23cb8f2578540e698f590bed35f973a22a8c2f90 (patch)
tree9ed8a70b28f433aa74172297960ccd9fb6b9ed4f /bot.go
parent4f0bce50c53267a9f53938ad1b264d5094a08ce4 (diff)
Chore: remove AutoCleanToolCallsFromCtx, atomic model color
Diffstat (limited to 'bot.go')
-rw-r--r--bot.go19
1 files changed, 8 insertions, 11 deletions
diff --git a/bot.go b/bot.go
index 0b4328f..315491a 100644
--- a/bot.go
+++ b/bot.go
@@ -851,7 +851,7 @@ out:
if thinkingCollapsed {
// Show placeholder immediately when thinking starts in collapsed mode
fmt.Fprint(textView, "[yellow::i][thinking... (press Alt+T to expand)][-:-:-]")
- if scrollToEndEnabled {
+ if cfg.AutoScrollEnabled {
textView.ScrollToEnd()
}
respText.WriteString(chunk)
@@ -866,7 +866,7 @@ out:
// Thinking already displayed as placeholder, just update respText
respText.WriteString(chunk)
justExitedThinkingCollapsed = true
- if scrollToEndEnabled {
+ if cfg.AutoScrollEnabled {
textView.ScrollToEnd()
}
continue
@@ -888,7 +888,7 @@ out:
respText.WriteString(chunk)
// Update the message in chatBody.Messages so it persists during Alt+T
chatBody.Messages[msgIdx].Content = respText.String()
- if scrollToEndEnabled {
+ if cfg.AutoScrollEnabled {
textView.ScrollToEnd()
}
// Send chunk to audio stream handler
@@ -898,7 +898,7 @@ out:
case toolChunk := <-openAIToolChan:
fmt.Fprint(textView, toolChunk)
toolResp.WriteString(toolChunk)
- if scrollToEndEnabled {
+ if cfg.AutoScrollEnabled {
textView.ScrollToEnd()
}
case <-streamDone:
@@ -906,7 +906,7 @@ out:
chunk := <-chunkChan
fmt.Fprint(textView, chunk)
respText.WriteString(chunk)
- if scrollToEndEnabled {
+ if cfg.AutoScrollEnabled {
textView.ScrollToEnd()
}
if cfg.TTS_ENABLED {
@@ -1394,9 +1394,6 @@ func updateModelLists() {
localModelsMu.Lock()
LocalModels = ml
localModelsMu.Unlock()
- for statusLineWidget == nil {
- time.Sleep(time.Millisecond * 100)
- }
// set already loaded model in llama.cpp
if !isLocalLlamacpp() {
return
@@ -1408,7 +1405,7 @@ func updateModelLists() {
m := strings.TrimPrefix(LocalModels[i], models.LoadedMark)
cfg.CurrentModel = m
chatBody.Model = m
- cachedModelColor = "green"
+ cachedModelColor.Store("green")
updateStatusLine()
updateToolCapabilities()
app.Draw()
@@ -1546,8 +1543,8 @@ func init() {
}
}
}
- // Initialize scrollToEndEnabled based on config
- scrollToEndEnabled = cfg.AutoScrollEnabled
+ // atomic default values
+ cachedModelColor.Store("orange")
go chatWatcher(ctx)
initTUI()
initTools()