Engine surging

truck starts and runs fine. after about 30 minutes, especially in the heat, it surges at low RPM. I will have to feather the throttle to get it to go from a stop. ultimately it dies. seems not to be getting enough fuel. after a while it will start and run fine again. what can i check. it is fuel injected. 1986 model with new engine about 2 years and 5-6000 miles ago.

I am guessing it is getting a little too warm. Does it tend to do it more when the tank is below half full?

You may be right. Fuel pressure may be falling off. How would one know? One could put a fuel pressure gauge on it, and measure the fuel pressure after the engine has been running about 30 minuets.
The engine was changed; but, how about the fuel filter? Change it, regardless, now.

the problem happens regardless of fuel level but yesterday i was probably about 1/2 full and it was the hardest to restart it has ever been. it would start to catch and i could barely keep it going for 10-20 seconds be quickly feathering the throttle but it wouldn’t quite catch. when it did catch, after about 30 min. it ran fine again. temp was probably 100 outside.