The brass fitting is a coolant sensor. That won't screw up your idle. The secong thing looks like it is pointing under your exhaust header. That looks like your PCV valve and hose. THAT will mess up your idle if it had gone out or there is a leak.
Have your tried the idle reset yet?
Disconnect your negative battery terminal from your battery and then pull your ECM fuse, (think number 12, not sure now) and leave it for 15 minutes. Come back, plug fuse back in and reconnect your battery. Drive your car like so..
Start it and run it for a few minutes in park. Now put car in drive and leave it for a minute. Now drive around at various speeds. Do stop and go. Don't forget about highway driving also. This should all take about 20-30 minutes.
Your computer should re-learn the fuel curve and stuff like that. That may help.