quit agent via special task rather than os._exit