summaryrefslogtreecommitdiff
path: root/bot.go
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2026-02-21 20:42:43 +0300
committerGrail Finder <wohilas@gmail.com>2026-02-21 20:42:43 +0300
commit2c694e2b2b76ea9a5b30dbd979731ba92cb1e3ba (patch)
treea0bdc0e4634c71432a3cec4c16e5d54fa6c0910b /bot.go
parent66ccb7a7322780a61b675e827794a8330aef3f89 (diff)
Enha: add (loaded) suffix if model is loaded
Diffstat (limited to 'bot.go')
-rw-r--r--bot.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/bot.go b/bot.go
index 227751d..fa59de6 100644
--- a/bot.go
+++ b/bot.go
@@ -403,6 +403,23 @@ func fetchLCPModels() ([]string, error) {
return localModels, nil
}
+// fetchLCPModelsWithLoadStatus returns models with "(loaded)" indicator for loaded models
+func fetchLCPModelsWithLoadStatus() ([]string, error) {
+ models, err := fetchLCPModelsWithStatus()
+ if err != nil {
+ return nil, err
+ }
+ result := make([]string, 0, len(models.Data))
+ for _, m := range models.Data {
+ modelName := m.ID
+ if m.Status.Value == "loaded" {
+ modelName = modelName + " (loaded)"
+ }
+ result = append(result, modelName)
+ }
+ return result, nil
+}
+
// fetchLCPModelsWithStatus returns the full LCPModels struct including status information.
func fetchLCPModelsWithStatus() (*models.LCPModels, error) {
resp, err := http.Get(cfg.FetchModelNameAPI)
@@ -832,6 +849,7 @@ func chatRound(r *models.ChatRoundReq) error {
// Variables for handling thinking blocks during streaming
inThinkingBlock := false
thinkingBuffer := strings.Builder{}
+ justExitedThinkingCollapsed := false
out:
for {
select {
@@ -859,6 +877,7 @@ out:
if thinkingCollapsed {
// Thinking already displayed as placeholder, just update respText
respText.WriteString(chunk)
+ justExitedThinkingCollapsed = true
if scrollToEndEnabled {
textView.ScrollToEnd()
}
@@ -872,6 +891,11 @@ out:
}
// If not collapsed, fall through to normal display
}
+ // Add spacing after collapsed thinking block before real response
+ if justExitedThinkingCollapsed {
+ chunk = "\n\n" + chunk
+ justExitedThinkingCollapsed = false
+ }
fmt.Fprint(textView, chunk)
respText.WriteString(chunk)
// Update the message in chatBody.Messages so it persists during Alt+T