Pontiac Grand Am 2003

Hello,

I  have service engine soon light, CarMD diagnostic tool shows OBD P0130 & P0171.  They have been on and off for about eight months now.  Every 30-40 miles the SES disapears then  shows up again after 30-40 miles. The car passed California smog test while the SES was off. The car fuel consumption is not that impacted.

Should I go ahead and fix it or just leave it? Thanks