feat: hide tool calls

This commit is contained in:
adamdottv 2025-05-05 11:25:34 -05:00
parent 874715838a
commit efaba6c5b8
No known key found for this signature in database
GPG key ID: 9CB48779AF150E75
3 changed files with 56 additions and 32 deletions

View file

@ -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
}