diff --git a/internal/ui/model/ui.go b/internal/ui/model/ui.go index d7df5940c89dfeb595a5a7aa1077fb3d56e1324a..981d6f56aeef564539ed2a976299fa87aa03e96a 100644 --- a/internal/ui/model/ui.go +++ b/internal/ui/model/ui.go @@ -560,6 +560,10 @@ func (m *UI) handleKeyPressMsg(msg tea.KeyPressMsg) tea.Cmd { m.newSession() m.dialog.CloseDialog(dialog.CommandsID) case dialog.CompactMsg: + if m.com.App.AgentCoordinator != nil && m.com.App.AgentCoordinator.IsBusy() { + cmds = append(cmds, uiutil.ReportWarn("Agent is busy, please wait before summarizing session...")) + break + } err := m.com.App.AgentCoordinator.Summarize(context.Background(), msg.SessionID) if err != nil { cmds = append(cmds, uiutil.ReportError(err))