From e52143407367e54f5b04177957f5f0436e28718b Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Sat, 28 Feb 2026 07:57:49 +0300 Subject: Refactor: move msg totext method to main package logic requires reference to config --- bot.go | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'bot.go') diff --git a/bot.go b/bot.go index 247c0dd..6b46c52 100644 --- a/bot.go +++ b/bot.go @@ -1226,7 +1226,7 @@ func chatToTextSlice(messages []models.RoleMsg, showSys bool) []string { if messages[i].Role == cfg.ToolRole || messages[i].Role == "tool" { // Always show shell commands if messages[i].IsShellCommand { - resp[i] = messages[i].ToText(i) + resp[i] = MsgToText(i, &messages[i]) continue } // Hide non-shell tool responses when collapsed @@ -1235,14 +1235,14 @@ func chatToTextSlice(messages []models.RoleMsg, showSys bool) []string { continue } // When expanded, show tool responses - resp[i] = messages[i].ToText(i) + resp[i] = MsgToText(i, &messages[i]) continue } // INFO: skips system msg when showSys is false if !showSys && messages[i].Role == "system" { continue } - resp[i] = messages[i].ToText(i) + resp[i] = MsgToText(i, &messages[i]) } return resp } @@ -1397,15 +1397,6 @@ func init() { os.Exit(1) return } - // Set image base directory for path display - baseDir := cfg.FilePickerDir - if baseDir == "" || baseDir == "." { - // Resolve "." to current working directory - if wd, err := os.Getwd(); err == nil { - baseDir = wd - } - } - models.SetImageBaseDir(baseDir) defaultStarter = []models.RoleMsg{ {Role: "system", Content: basicSysMsg}, {Role: cfg.AssistantRole, Content: defaultFirstMsg}, -- cgit v1.2.3