If the person who cast spiritual ally cannot see an enemy, because they are in darkness, for example, and it wasn't the original enemy that the caster told the spiritual ally to attack, can the spiritual ally still attack it? How much awareness of the enemy does the caster need to have? What if they know the enemy is there but cant see them? What if the spiritual ally knows the enemy is there but the caster doesn't?
I'd treat it like any other targeted spell, you'd need to see the new target to direct the spiritual ally to attack. Moving a spell to a new target is mentioned in the same section after all.
There's no evidence the spiritual ally has senses or knowledge in any meaningful sense of those words and you wouldn't be able to rely on the ally to self-target to a new enemy IMO.
The wording of the spell is annoyingly ambiguous. It doesn't use the word target but instead "designate".
It's not really that ambiguous actually... the ambiguity that does exist in the wording is actually more of a necessity than an annoyance when you really get into it. The use of "designate" instead of "target" is there to open the door for precisely what you're asking about here. You can designate a square that you believe a foe to be in as your foe for an attack, allowing them to attack an invisible or concealed target.