Просмотр исходного кода

fix(tui): redundant tool calls in each message in collapsed mode

adamdottv 7 месяцев назад
Родитель
Сommit
c389e0ed43
1 измененных файлов с 5 добавлено и 1 удалено
  1. 5 1
      packages/tui/internal/components/chat/messages.go

+ 5 - 1
packages/tui/internal/components/chat/messages.go

@@ -174,12 +174,16 @@ func (m *messagesComponent) renderView(width int) {
 						orphanedToolCalls = make([]opencode.ToolInvocationPart, 0)
 					}
 
+					remaining := true
 					for _, part := range remainingParts {
+						if !remaining {
+							break
+						}
 						switch part := part.AsUnion().(type) {
 						case opencode.TextPart:
 							// we only want tool calls associated with the current text part.
 							// if we hit another text part, we're done.
-							break
+							remaining = false
 						case opencode.ToolInvocationPart:
 							toolCallParts = append(toolCallParts, part)
 							if part.ToolInvocation.State != "result" {