Skip to content

Commit 8f230ad

Browse files
authored
fix: interface conversion panic (sst#2060)
1 parent c0f90eb commit 8f230ad

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

packages/tui/internal/components/chat/messages.go

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -746,16 +746,18 @@ func (m *messagesComponent) renderView() tea.Cmd {
746746
} else {
747747
for _, part := range response.Parts {
748748
if part.CallID == m.app.CurrentPermission.CallID {
749-
content := renderToolDetails(
750-
m.app,
751-
part.AsUnion().(opencode.ToolPart),
752-
m.app.CurrentPermission,
753-
width,
754-
)
755-
if content != "" {
756-
partCount++
757-
lineCount += lipgloss.Height(content) + 1
758-
blocks = append(blocks, content)
749+
if toolPart, ok := part.AsUnion().(opencode.ToolPart); ok {
750+
content := renderToolDetails(
751+
m.app,
752+
toolPart,
753+
m.app.CurrentPermission,
754+
width,
755+
)
756+
if content != "" {
757+
partCount++
758+
lineCount += lipgloss.Height(content) + 1
759+
blocks = append(blocks, content)
760+
}
759761
}
760762
}
761763
}

0 commit comments

Comments
 (0)