From 9488c5773ea7757a1548a7c1ddec7c70e724b919 Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Wed, 8 Apr 2026 12:26:59 +0300 Subject: [PATCH] Enha: tool args preview --- bot.go | 8 ++++++-- helpfuncs.go | 1 - 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/bot.go b/bot.go index 384563e..84f1a44 100644 --- a/bot.go +++ b/bot.go @@ -1398,10 +1398,14 @@ func chatToTextSlice(messages []models.RoleMsg, showSys bool) []string { // This is a tool call indicator - show collapsed if toolCollapsed { toolName := messages[i].ToolCall.Name + argsPreview := messages[i].ToolCall.Args + if len(messages[i].ToolCall.Args) > 30 { + argsPreview = messages[i].ToolCall.Args[:30] + } resp[i] = strings.ReplaceAll( fmt.Sprintf( - "%s\n%s\n[yellow::i][tool call: %s (press Ctrl+T to expand)][-:-:-]\n", - icon, messages[i].GetText(), toolName), + "%s\n%s\n[yellow::i][tool call: %s %s (press Ctrl+T to expand)][-:-:-]\n", + icon, messages[i].GetText(), toolName, argsPreview), "\n\n", "\n") } else { // Show full tool call info diff --git a/helpfuncs.go b/helpfuncs.go index 057b368..f8a85c3 100644 --- a/helpfuncs.go +++ b/helpfuncs.go @@ -595,7 +595,6 @@ func executeCommandAndDisplay(cmdText string) { return } } - // Use /bin/sh to support pipes, redirects, etc. cmd := exec.Command("/bin/sh", "-c", cmdText) cmd.Dir = workingDir