The base answer is that it depends. Usually there is a an officer who is watching the ci to see what they are doing. You should hire an experienced criminal defense attorney to handle this matter. I would be happy to discuss the matter further with you as I work all over PA on these kind of cases.
I completely understand the basic question, and it's a tremendous question. The problem for me is that I can't possibly provide and reasoned and intelligent answer on the minimum facts presented. I do NOT, however, recommend that you provide any further details on this public website or anywhere else on the Internet. You do not indicate your connection to the case which is good, but if the defendant, whoever he/she may be has an attorney then that person should be the sole source of information and advice about the case. On the other hand, if not presently represented, that person needs to speak privately and confidentially with qualified drug defense counsel without delay. From my experience in drug law enforcement, I know that controlled or "snitch" buys are not commonly charged by the Commonwealth. they are instead investigative steps normally geared to introducing an undercover officer to make future buys from the target and/or gather information to support one or more search warrants. The reason they are not commonly prosecuted is that most CI's come with a lot of bad "baggage". CI's are not seminary students moonlighting to make extra money. They are unreliable as witnesses and often the Commonwealth is not willing to reveal their identity much less expose them to cross-examination in a courtroom. Make sure the subject of the charge(s) has a good attorney. Good luck.
It's not a closed loop problem (marked money, CI is plain view going to and from buy with no stops, CI searched prior to buy and immediately return to officer where CI is searched again), but it does not render the buy being bad for a jury. It depends on how good the CI is, his prior experience and reputation with police. The flakier the CI, the more problematic the bust is.
Make an appointment with a good criminal defense attorney in Pittsburgh area.