When the effects of either Number 13 or Number 31 are activated, the AI can ignore the "must attack this card" clause and skip the Battle Phase if they control no monster with a higher attack than 13/31.

I've tested this in non-AI duels with no issue, so the AI just doesn't like the must attack clause.