I've looked at various conversations on here, Reddit, and other forums, but I can't seem to find any official ruling on this topic, so I figured I'd ask here and see if anyone knows of any.
There are other summoning spells, but in this instance I'm specifically referring to the Xanathar's Guide To Everything spell Summon Lesser Demons. The demons are not under the caster's control, have their own initiative and attack any non-demon in reach until they are either killed or the spell ends/is ended.
As an example, in our last session the wizard summoned 4 dretches to help in combat. One of the enemies killed one of the dretches, then, with no other enemies left, the party attacked the dretches, killing 2 of them. The wizard then ended the spell, getting rid of the fourth. Should the party be awarded for killing those 2 dretches?
RAW, it seems that if it's not a creature under your control that will attack you and the spell doesn't say anything to the contrary, they should be awarded XP for killing them. Of course, this immediately led to the party joking about XP farming. It'd have diminishing returns, but is still a loophole that I'd rather not leave open. (I know, DM fiat, I'm just wondering if there is any RAW or even RAI that would prevent it without me making a 'house rule' ruling on it.)