fix: interface conversion panic (#2060)

pull/2065/head
Aiden Cline 2025-08-19 05:25:46 -05:00 committed by GitHub
parent c0f90eb564
commit 8f230ad4b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 12 additions and 10 deletions

View File

@ -746,16 +746,18 @@ func (m *messagesComponent) renderView() tea.Cmd {
} else {
for _, part := range response.Parts {
if part.CallID == m.app.CurrentPermission.CallID {
content := renderToolDetails(
m.app,
part.AsUnion().(opencode.ToolPart),
m.app.CurrentPermission,
width,
)
if content != "" {
partCount++
lineCount += lipgloss.Height(content) + 1
blocks = append(blocks, content)
if toolPart, ok := part.AsUnion().(opencode.ToolPart); ok {
content := renderToolDetails(
m.app,
toolPart,
m.app.CurrentPermission,
width,
)
if content != "" {
partCount++
lineCount += lipgloss.Height(content) + 1
blocks = append(blocks, content)
}
}
}
}