when the AI is attacked, and the attacking units retreat, the AI follows them and them decide at some point to stop and go back to its base. But as the units were chasing the enemies, UnitAI has still the control and make the units continue the chase, usually driven by the retreating enemy up to towers or fortress where they are killed. The patch let the AI really stop the chase.
the patch is not complete though, as the same problem could happen again if the enemy attack again the AI while it is going back to its base, and then retreat again. But that should be another patch.