summaryrefslogtreecommitdiffhomepage
path: root/internal/tui/components/chat/message.go
diff options
context:
space:
mode:
authoradamdottv <[email protected]>2025-05-05 11:25:34 -0500
committeradamdottv <[email protected]>2025-05-05 11:25:34 -0500
commitefaba6c5b8aed4aab620d9633d4335eaeed32be0 (patch)
tree7c62e01a77b7c74cbcfd9549ac8f9e0fd1df3629 /internal/tui/components/chat/message.go
parent874715838af25915061048ac20ea536363d62fb7 (diff)
downloadopencode-efaba6c5b8aed4aab620d9633d4335eaeed32be0.tar.gz
opencode-efaba6c5b8aed4aab620d9633d4335eaeed32be0.zip
feat: hide tool calls
Diffstat (limited to 'internal/tui/components/chat/message.go')
-rw-r--r--internal/tui/components/chat/message.go30
1 files changed, 17 insertions, 13 deletions
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
}