From c389e0ed439c741781c9fa321a7773dd608c83d4 Mon Sep 17 00:00:00 2001 From: adamdottv <2363879+adamdottv@users.noreply.github.com> Date: Thu, 3 Jul 2025 10:42:27 -0500 Subject: [PATCH] fix(tui): redundant tool calls in each message in collapsed mode --- packages/tui/internal/components/chat/messages.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/tui/internal/components/chat/messages.go b/packages/tui/internal/components/chat/messages.go index 1b238992..52288078 100644 --- a/packages/tui/internal/components/chat/messages.go +++ b/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" {