Handle invalid agent responses