We have something called "procuring cause" for what causes an agent to get paid when a buyer buys a home. Essentially, procuring cause is an uninterrupted sequence of steps that results in the buyer buying the home. That definition doesn't have a time line, but it does have that fun "uninterrupted" bit to hurdle. The time line, in which it needs to be uninterrupted, is from the time you saw a home, until the time you decided to buy the home, not necessarily until the time that you actually wrote a contract or close on the property. Just the time between being completely unaware that the property existed, until you've made a decision to buy the property.
If you've already made the decision which home you are going to buy, your current agent has probably met the definition for procuring cause and as such, has "earned" a commission. If you have not made a decision, and you do indeed fire your current agent, then even though they showed you a house that you later bought, it would appear as though the sequence of events was indeed interrupted, and your current agent would not be entitled to a commission. Obviously, this is a sticky situation, and depending on the scruples of your current agent, the money involved, and how hard they feel they've worked, may result in a huge fight, or it not being an issue at all.
If you signed a Buyer-Broker Employment agreement, you will certainly need to work to be released from that agreement, because it states clearly in the employment agreement that your current agent will get paid if you buy anything during the employment period.
Further, if the agent in question is able to establish procuring cause, that doesn't mean you still cannot get another agent. Agency and compensation are two separate things, such that you can always fire your agent and get a new one. You may need to compensate them, and the new agent will probably want compensation as well, but you can get another agent. It might cost some money from your pocket to pay two agents, where you weren't expecting to need to do that.