I agree, the AI goes out of its way to target spellcasters first and then keep kicking them when they're down, rather than deal with other threats. Doesn't make sense to me. Until your wizard lets fly with a spell, how do they know it's a spellcaster (and therefore dangerous)? It could be a merchant, in which case dealing with the obviously armed and dangerous fighters first would make more sense.