summaryrefslogtreecommitdiff
path: root/bot.go
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2026-02-17 13:15:09 +0300
committerGrail Finder <wohilas@gmail.com>2026-02-17 13:15:09 +0300
commit372e49199b58281bf1c7f75dfa2835189bc61383 (patch)
tree3304cc1b343a8d5ebad5c8b14dafce03f1ba5b21 /bot.go
parentd6d4f09f8d742b5b1340a0ebcbd125c6f6ecd9d3 (diff)
Feat: collapse/expand thinking blocks with alt+t
Diffstat (limited to 'bot.go')
-rw-r--r--bot.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/bot.go b/bot.go
index 0ac94f7..61d33fa 100644
--- a/bot.go
+++ b/bot.go
@@ -1087,7 +1087,15 @@ func chatToTextSlice(messages []models.RoleMsg, showSys bool) []string {
func chatToText(messages []models.RoleMsg, showSys bool) string {
s := chatToTextSlice(messages, showSys)
- return strings.Join(s, "\n")
+ text := strings.Join(s, "\n")
+
+ // Collapse thinking blocks if enabled
+ if thinkingCollapsed {
+ placeholder := "[yellow::i][thinking... (press Alt+T to expand)][-:-:-]"
+ text = thinkRE.ReplaceAllString(text, placeholder)
+ }
+
+ return text
}
func removeThinking(chatBody *models.ChatBody) {