I took out my air intake box one day (which included the little sensor located on top of the box) due to a problem with my HID's with a faulty wire (which leo replaced under warranty

)
I was getting the CEL bullshit and lights everywhere, I went through a few steps thanks to Leo (hks180) and Michael(PHAT GT) on the phone (another reason why you should make friends with these guys if you don't know anyone that is knowledgeable about Subies

)
I ended up taking all of the airbox stuff out, including unplugging the wire to the airbox sensor, and also doing an ECU reset by leaving the battery unplugged for 15 minutes and hitting the brake a few times.
It fixed the problem in the end for me, but of course with a CAI it's something the ECU is probably not used to, so if you can try what I have tried and it still doesn't work, do what Gambit has said.
Good luck.