From efaba6c5b8aed4aab620d9633d4335eaeed32be0 Mon Sep 17 00:00:00 2001 From: adamdottv <2363879+adamdottv@users.noreply.github.com> Date: Mon, 5 May 2025 11:25:34 -0500 Subject: feat: hide tool calls --- internal/tui/components/chat/message.go | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'internal/tui/components/chat/message.go') diff --git a/internal/tui/components/chat/message.go b/internal/tui/components/chat/message.go index 64006113d..f5f50f03a 100644 --- a/internal/tui/components/chat/message.go +++ b/internal/tui/components/chat/message.go @@ -134,6 +134,7 @@ func renderAssistantMessage( focusedUIMessageId string, width int, position int, + showToolMessages bool, ) []uiMessage { messages := []uiMessage{} content := msg.Content().String() @@ -212,19 +213,22 @@ func renderAssistantMessage( position++ // for the space } - for i, toolCall := range msg.ToolCalls() { - toolCallContent := renderToolMessage( - toolCall, - allMessages, - messagesService, - focusedUIMessageId, - false, - width, - i+1, - ) - messages = append(messages, toolCallContent) - position += toolCallContent.height - position++ // for the space + // Only render tool messages if they should be shown + if showToolMessages { + for i, toolCall := range msg.ToolCalls() { + toolCallContent := renderToolMessage( + toolCall, + allMessages, + messagesService, + focusedUIMessageId, + false, + width, + i+1, + ) + messages = append(messages, toolCallContent) + position += toolCallContent.height + position++ // for the space + } } return messages } -- cgit v1.2.3