mirror of
https://github.com/sst/opencode.git
synced 2025-07-07 16:14:59 +00:00
fix(tui): redundant tool calls in each message in collapsed mode
This commit is contained in:
parent
204801052a
commit
c389e0ed43
1 changed files with 5 additions and 1 deletions
|
@ -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" {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue