mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-06 00:12:11 +00:00
feat: hide tool calls
This commit is contained in:
parent
874715838a
commit
efaba6c5b8
3 changed files with 56 additions and 32 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue