How recent a break up? Assuming you have all had time to process this break up, and assuming he cleared her coming over with you before hand and you know what your expected role in this gathering is....
If you agreed to cohost,
hiding in your room is bad manners. You have to see to your guests -- be present, check on drinks, offer snacks, make conversation, introduce people who need intros and all that hosting jazz. You discover you not up for this? Don't sign up for this any more in future and make the best of this one time and chalk it up to learning something new.
If he's hosting his friends
, you just have to be polite if you pass through to get a drink or bathroom -- you are not obligated to co-host.
If he didn't clear an ex coming over
to hang out in your shared home with you, his live-in lover, and you stumble in on this awkward... that's putting you on the spot and in a weird place in your own home
and not really looking out for your emotional safety. There's rights and responsibilities
You discover you have a limit that you do not want exes hanging around at the house? State this and negotiate the line on it. Chalk it up to learning something new about yourselves on exes limits. Maybe he can hang out with them elsewhere if you are home or hang with them at home when you are out elsewhere. (His home too after all.) Maybe it's a soft limit that you can renegotiate and move the line some when you are more poly experienced and more comfortable. Maybe it's a hard limit line. Who knows. Talk it out with your partner to find the happy medium.