Hello and welcome to Justanswer!
Your codes are consistant with losing throttle response while driving. Is that what is happening? The pedal stops working, and then throttle response comes back on it's own?
So the engine doesn't shut down and you have to restart it, you just lose throttle response and it returns to idle, correct?
When the engine controller thinks it doesn't have complete control over the engine it will return fuel control to the idle governor. These codes you have set are definitely codes that would cause it to do that. P2121 is "APPS volts do not agree with idle validation signal", and the P2122 is "low voltage at the APPS". The APPS is the sensor that tells the engine controller how far the throttle is open. It's mounted under the black plastic cover on the left/front of the cylinder head where the throttle cables go in. Your problem could be caused by wiring or an internal engine controller problem, but it's highly likely the APPS itself. Give the wiring a close inspection, looking for any areas that look damaged or could be rubbed through. The best way to diagnose this is with a scan tool and a voltmeter on the truck, at the time is acting up, but that's very hard to accomplish since it's an intermittent problem that happens while you are driving. Most of the time with these codes and symptoms you would do a close wiring inspection, and if all looked ok replace the sensor.