agent: send unit events only when necessary