I assume that is the right course of action, but is there a reasonable reason to leave the carrier alone? The first time I killed one, the units popped out, and were promptly slaughtered by my fleet. I might have lost a dozen fleet ships, which were rebuilt before I could even send my fleet home.
So. Kill em or leave em?
Carriers are a game mechanic introduced to allow very large numbers of AI ships to be handled without melting your processor or turning battles into multi-hour slide shows. So when you see an AI carrier, it's usually at least somewhat dangerous.
Threat initially behaves in a fairly simple manner. AI ship have a target system they want to attack. If the system has too many defenses, the AI ships will pull back from the wormhole to that system a little ways, and wait for more AI ships to join them. If enough do, they'll attack.
But if they don't, after a while (20 minutes? Something like that) Threat joins what's called the Threatfleet. At this point, the AI units stop targeting a specific human system, and pull back to a single common point somewhere in AI space. By gathering this way, the Threatfleet becomes more and more powerful, and more difficult for the human play to find and attack. If you just leave them alone, then the Threatfleet will grow to the point where it can overpower your defenses, and then attack. And the Threatfleet is smarter than normal Threat, too - it always targets you weakest system and most valuable resources, rather than just what happens to be nearby.
Different people have different methods of dealing with loose Threat (which is what CPA ships are - a large release of ships into Threat).
I prefer to go kill Threat as soon as possible, to prevent the Threafleet from forming, or getting powerful.
Some people prefer to let them get big enough, then bait them into attacking a strongly fortified world. This is not easy these days, after the AI got some improvements, but it can still be done.
Some people just ignore them entirely, relying on Warheads to clean up the attack when it finally comes.
The most basic thing to remember is that Carriers represent large number of AI ships, and that CPAs, and Threat in general, are just very large numbers of ships waiting to attack you the second you show weakness. It isn't the normal waves that usually kill experienced players - it's the sledgehammer of the CPAs.