I have no idea what to do 😓

Please no negativity ! This is a pretty long story but I need help and support. Let me start off by saying two things 1) I have PCOS and Hashimotos making it very difficult to get pregnant and stay pregnant. 2) me and my boyfriend are in a open relationship. I know it’s not for everyone but we are ok with it and our relationship so no negativity, also he is fixed (prior to our relationship so he can’t have babies. Anyways a few months back I was sleeping with some guy and everything was find and dandy until I went in for a surgery and found out I was pregnant. Immediately my boyfriend had his sperm tested (just in case). Came back negative so we knew exactly who the dad was. I told the dad everything and was up front and honest. Anyways later on at 12 weeks I miss-carried. My boyfriend was there for me the whole time but it did hurt our relationship. It was very hard to go Through in the both of us. But the actual father wanted nothing to do with the baby and my boyfriend was amazing and wanted to raise the baby. It took a huge emotional toll on him.. fast forward trough all of this and here we are a few months later. I again went in to have the surgery because we had to put it off since I was pregnant the first time... I get into the room and the nurse comes back and says to me that the test came back positive.. I about have a freaking meltdown.. I’m on a more natural way of birth control because hormones and the birth control pill caused me to have a stroke several years ago... now I know the consequences and I know the risk I have and was taking. I don’t need a lecture on that.. so please don’t start on that. I fully understand. But now I’m freaking out. Doctor went through with the surgery because my levels were extremely low and I begged them to go through with the surgery because I can’t deal with the pain anymore... but now I’m at complete loss on what to do... do I tell my boyfriend ? Do I wait Incase I miscarry again? I never make it past 12 weeks.. I don’t know what the F**k to do. I don’t want to put him through this again. I know he would be there for me but I don’t want to hurt him or something happen. Do I tell the other guy ? 😓

EDIT*** so y’all can stop with this comment as well, we did use a condom. That is our rule. I’m sure y’all will go on with saying then pull out as well blah blah... that’s not the point here. We did use protection.