Something is failing at run temp. Some things that cause this can be, coil packs, crank sensors, cam sensors, fuel pumps, distributors, caps ,rotors, and plug wires. Or it could be egr related. My son's mazda had the same symptoms and it was the crank sensor. Also the sunfire is a rebadged chevy cavalier.