when the main creatures are destroyed, the summoned creatures disappear
The second option: do not allow the battle to end automatically until at least one side has a squad. For example, this is how I implemented the battle with a mage in the fifth mission.
function finish()
EnableAutoFinish(nil)
while not combatStarted() do
sleep(20)
end
while GetCreatures(0)[0] and GetCreatures(1)[0] do
sleep(20)
end
EnableAutoFinish(1)
end
startThread(finish)