The mass air flow sensor can cause this issue, if you have a K and N style air filter the oil can get on the sensor ans cause a false reading. You can clean the sensor to make sure there is nothing on the sensor such as dirt or oil. Remove the sensor from the air cleaner, spray some carb or throttle cleaner in to the sensor. You should be able to see small wires inside, clean the wires with the spray. It does not take much to clean the sensors.
The O2 sensors are less likely to cause this issue with out setting a O2 sensor code, and both front o2 sensors would have to have the same problem since you have lean codes on both banks of the engine.
The intake gasket, How was it tested? You may have heard that its been a problem. GM has redesigned it and has a bulletin for your symptoms. Cold rough idle, p0171 and p0174. Lets explore it a little. If you have never had them replaced before, then they are bad. The gaskets go flat and can no longer seal. The new gaskets do not have this problem. The gaskets normally leak at the bottom of the intake and is very hard to test. If you have some time, remove the intake, its not hard and the gaskets are reusable. remove the intake and look at the gasket. If they are orange, they are the original, if they are green, they are the new style. Look to see if the rubber part is flat in any area, if it is, then they are not sealing.
Lets stop talking to other techs unless they are GM techs. The GM techs are going to know this truck very well. i work on about 10 of these trucks week on average. However that does not mean the other ideas are good or bad, but lets look at what normally goes bad on these trucks.
Water in the fuel will not cause the lean codes p0171, p0174. It will cause the engine to mis-fire and the check engine light to flash, code p0300 to set.
A catalytic converter can cause some major issues, normally you will get a lack of power and or a p0420, p0430 to set.
One cause is also possible, you used E-85 fuel in a non flex fuse truck. This should have cleared up at your next fuel up with normal gas.
Now lets get down to the most likely cause. The intake gaskets were not checked properly. You can not test for a vacuum leak with a vacuum gauge. You need a scan tool that reads engine data such as the fuel trims. Wile looking at the fuel trims, you need to spray carb cleaner to the under side of the intake wile the truck is runing and see if the fuel trims change. This is the only test to check the gaskets with out a visual inspection.
Here is some information on this issue that GM has put out.
#PIP3232B: Cold Engine Idle Misfire Or DTCs P0171 P0174 - keywords 4.8 5.3 6.0 air cold crack hesitate idle intermittent internal intake leak lean misfire miss P0171 P0174 P0300 power rough surge vacuum - (Feb 7, 2007)
99 through 05 GEN III truck engines may experience any of the following:
The intake gasket seals may be leaking around the intake ports, causing a lean condition. The intake gasket seals may leak around the bottom side of the port, making it a challenge to detect the vacuum leak. The technician may also notice lower than normal MAF readings if the intake seals are leaking.
The noise is most likely a lifter. This is common on this engine, should not affect engine operation unless the noise does not go away. You may try adding some Reslone oil treatment at you next oil change, this will clean out the lifters and may help. At this time, I would not want to replace the lifters, the cost is around $2400.
Using premium gas will not help any, if you are using a good brand of fuel, you should not have any problems. Stay way from the Mom and Pop fuel stations.
Fuel station is good, there is no recall, just information. Oil additive is good.
I would replace the intake gaskets if they have never been replaced before.
I no not have any photos, however it is easy to replace the intake gaskets. Remove the engine cover, unplug the injectors. Remove the fuel lines at the drivers side rear of the engine(you will need a release tool, not expensive at your local auto store), 2 electrical connectors at the rear of the intake, 12 small bolts and the intake can come out.
Should take about a hour (takes me about 10 mins).
Its a good idea to add the cleaner about every 3-4 fill ups.
If the catalytic converter was going bad, it can cause a lack of power, worse when hot. It can also cause one bank of the engine (left or right side cylinders) to have a mis-fire. Both cats do not go out at the same time so it may only affect the one side, this is why you may have mis-fires on only one bank of cylinders.
The dealership may have recommended a catalytic converter because some times if the engine has run lean for a long time, it can burn out the cat, this will give you a check engine light and codes P0420 and/or P0430 which means the cats are no longer working.