diff options
| author | Grail Finder <wohilas@gmail.com> | 2026-02-27 21:25:26 +0300 |
|---|---|---|
| committer | Grail Finder <wohilas@gmail.com> | 2026-02-27 21:25:26 +0300 |
| commit | 916c5d3904b366e9f7f6f12867f7f0b71791bb6f (patch) | |
| tree | 85182574cc8c2ead599c44dbe4dd6493cf0d1748 /bot.go | |
| parent | 5b1cbb46faf4c082c95b9e61d62b790defecd06a (diff) | |
Enha: icon for collapsed tools
Diffstat (limited to 'bot.go')
| -rw-r--r-- | bot.go | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -1208,16 +1208,17 @@ func findCall(msg, toolCall string) bool { func chatToTextSlice(messages []models.RoleMsg, showSys bool) []string { resp := make([]string, len(messages)) for i := range messages { + icon := fmt.Sprintf("[-:-:b](%d) <%s>:[-:-:-]", i, messages[i].Role) // Handle tool call indicators (assistant messages with tool call but empty content) - if (messages[i].Role == cfg.AssistantRole || messages[i].Role == "assistant") && messages[i].ToolCallID != "" && messages[i].Content == "" && len(messages[i].ToolCalls) > 0 { + if messages[i].Role == cfg.AssistantRole && len(messages[i].ToolCalls) > 0 { // This is a tool call indicator - show collapsed if toolCollapsed { toolName := messages[i].ToolCalls[0].Name - resp[i] = fmt.Sprintf("[yellow::i][tool call: %s (press Ctrl+T to expand)][-:-:-]", toolName) + resp[i] = fmt.Sprintf("%s\n[yellow::i][tool call: %s (press Ctrl+T to expand)][-:-:-]", icon, toolName) } else { // Show full tool call info toolName := messages[i].ToolCalls[0].Name - resp[i] = fmt.Sprintf("[yellow::i][tool call: %s][-:-:-]\nargs: %s", toolName, messages[i].ToolCalls[0].Args) + resp[i] = fmt.Sprintf("%s\n[yellow::i][tool call: %s][-:-:-]\nargs: %s", icon, toolName, messages[i].ToolCalls[0].Args) } continue } @@ -1230,6 +1231,7 @@ func chatToTextSlice(messages []models.RoleMsg, showSys bool) []string { } // Hide non-shell tool responses when collapsed if toolCollapsed { + resp[i] = icon + "\n[yellow::i][tool resp (press Ctrl+T to expand)][-:-:-]\n" continue } // When expanded, show tool responses |
