Something is wrong with the AI algorithms that is beyond repair. They don't need to be debugged, they need to be replaced. An infinite loop is an unacceptable product of poor algorithmic architecture. No one should ever have to have their game ruined by an AI that won't finish making a decision. That should never happen.