This is a very uncalled for topic and one that isn't worth discussing.
Why would you even think of a war situation?
What makes the discussion a necessity?
Have you ever been at war or lived in a nation at war?
War is something you don't want to happen to you, any of your loved once or even a distanced neighbour because, it's effect is not always so distanced.
Peace to Russia and Ukraine. Let's all heal from this as, its in a way taken a page on us all especially the people of both nations.
If anything, I would like Artificial intelligence to be used as a tool to end wars and reach mutual concensus between factions. While I agree than this topic is rather uncalled for, we should not ignore those questions OP is making, just because war is horrible, it does not mean we are supposed to ignore it's existence or the implications of it.
Nobody likes to think about illness, but we do not ignore it when there is a chance we suffer from one.
I think that considering how fast things are going with AI, it would be just matter of time before some general starts to ask advice to a machine. From there, the scenario would become more and more dangerous as governments give AIs more freedom over human troops or even war machines.