@@ -104,17 +104,24 @@ func (c *compactDialogCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
104104 }
105105
106106 case agent.AgentEvent:
107โ if msg.Type == agent.AgentEventTypeSummarize {
107+ switch msg.Type {
108+ case agent.AgentEventTypeSummarize:
108109 if msg.Error != nil {
109110 c.state = stateError
110111 c.progress = "Error: " + msg.Error.Error()
111112 } else if msg.Done {
112โ return c, util.CmdHandler(
113โ dialogs.CloseDialogMsg{},
114โ )
113+ return c, util.CmdHandler(dialogs.CloseDialogMsg{})
115114 } else {
116115 c.progress = msg.Progress
117116 }
117+ case agent.AgentEventTypeError:
118+ // Handle errors that occur during summarization but are sent as separate error events.
119+ c.state = stateError
120+ if msg.Error != nil {
121+ c.progress = "Error: " + msg.Error.Error()
122+ } else {
123+ c.progress = "An unknown error occurred"
124+ }
118125 }
119126 return c, nil
120127 }