A detective so upset at farewell (5)
I believe the answer is:
adios
'farewell' is the definition.
(adios is a kind of farewell)
'a detective so upset' is the wordplay.
'detective' becomes 'di' (Detective Inspector abbreviation).
'upset' shows that the letters should be reversed in order.
'so' back-to-front is 'os'.
'a'+'di'+'os'='ADIOS'
'at' is the link.
(Other definitions for adios that I've seen before include "So long, amigo" , "Goodbye to Spain" , "Good-bye (Sp.)" , "Au revoir, amigo!" , "Adieu, arrivederci" .)