Aircraft: COMMANDER 114/A/B/TC
Phase of flight: Cruise
Anomaly: Aircraft Equipment Problem Critical

I was flying home to ZZZ after a work assignment. Before departure I had the left tank filled; the right tank remained full from the previous flight and was confirmed by visual inspection as was the left tank. There was no water or contaminant in either tank when fuel was drained at the airport. The engine operated normally at start and during run up. The weather in Pensacola was almost clear sky with a rare; small; low cloud around 3000 ft. I climbed to 7000 ft and leaned the engine normally and was operating well. I had the single axis autopilot turned on and the aircraft was trimmed comfortably for hands off flying. After switching over to approach control; I was continuing as filed. My cruise settings were throttle full forward producing about 22 inches of mercury and 2200 RPM. This produced about 125 kts TAS. Mixture was set to about 1550 EGT. Fuel flow was about 9gph; I had planned to burn about 10gph at cruise. And the engine was running smoothly. I was running on the left tank as the left wing in my aircraft usually feels heavy when fuel load is equal.The aircraft has a Lycoming IO 360 200hp engine and at full throttle/mixture normally has fuel flow to almost 18 gph. About 25-30 miles SW of ZZZ1 airport; I noticed that my engine sounded like it was running lean or even missing on occasions. I first checked the fuel guage which showed > 1/2 tank which I expected. Then see that both mags were on; they were. Engine gauges showed a consistent manifold pressure of 22 inches and a fuel flow of 8GPH. EGT had dropped to just shy of 1500. I advanced the mixture control; and fuel flow did not change. I pulled the throttle back slightly; and fuel flow dropped; so I advanced it again; but the engine ran rougher than before with fuel flow gauge now showing variations in fuel flow below 8gph. As I was just about to head over the bay; I turned slightly north to stay by the coast line; I turned on the fuel pump; advanced the throttle; prop and mixture to full rich; and switch to both tanks. This made no difference in fuel flow which was still low; or manifold pressure which was still stable at 22 in mg. I decided to pull back the throttle about a half inch to see if the engine would run smoother if I reduced airflow given the poor fuel flow (if I dropped air intake; maybe the mixture would improve); but fuel flow dropped to 3-4 gph and the engine nearly choked. It returned to as it was once I advanced to full throttle again. At this point I looked at possible emergency landing options and there were no good options where I could be comfortable that I would not be injured and I welled with fear.I called ATC and told then my engine was running rough and that I would like to divert to ZZZ1 if possible. They asked about my fuel situation which I responded; full right and minimum 20 gallons in the left tank. Further; I informed them that I suspected fuel contamination; but he did not seem to understand my communication (my working theory was that perhaps some contaminant or ball of goo from recent tank resealing and recent fuel tank selector valve work was causing a blocked fuel line). I had lost altitude of about 400 ft during this as I suspect I was producing < 100hp with my rough running engine; so I nosed over to plan a descent into ZZZ1; and the engine choked again; but did not quit; then started running like usual; producing fuel flow to 14gph and sounded much improved. I told approach that things had seemed to work themselves out and I would like to continue the flight (in my opinion it must have been a contaminant that passed). The aircraft climbed normally. At this point I started to work through what had happened and possible locations of the problem because contaminated fuel just couldn't be the problem: 1. fuel contamination (not likely since I drained the tanks and found nothing before flight and I had already flown 1 hour without issues; but maybe debris worked itself loose from recent annual inspection now causing a partial obstruction) 2. Air induction system ice/obstruction (doubtful with no visible moisture and normal manifold pressure) 3. fuel system obstruction forward of the fuel selector valve (highly probable in my opinion as fuel flow was limited to 8gph with drops; but no improvements with advancing the mixture control or switching tanks; plus recent tank sealing at annual and fuel valve replaced; maybe something broke loose?). 4. fuel leak (doubtful to me; tanks just resealed and fuel gauges suggested what I would expect in the fuel tanks-- though in retrospect a leaking fuel line could have explained the symptoms). 5. failed mechanical fuel pump with parts obstructing the fuel system (possible because the electric fuel pump was turned on and remained in the on position with no increase in fuel flow). 6. Failing fuel injection system obstructing fuel flow (possible) 7. Loose or incompetent mixture control cable (possible) At this time; I was back level at 7000 ft but the engine was sounding lean again and the fuel flow again dropped to just under 8gph. I called ATC again and told them of my intention to divert to ZZZ1. Though the fuel flow indicated about 7-8 gph mostly; the increasing air intake made the mixture untenable and the engine only ran rougher; but pulling back on the throttle only made things worse due to decreased fuel flow when doing this; so I left the power quadrant untouched from that point on with full throttle; 2500 rpm and full mixture. My planned descent with horsepower at altitude should have had me arrive at the airport about 500 ft above pattern altitude; but as I got lower; horsepower dropped due to the mixture disparity (something I did not think to plan for). At about 3000 ft I was switched to tower and they were talking to the emergency response team which took me slightly by surprise as I did not realize I had [already advised ATC]. I didn't see the need to have a response team called as if I made the field; there would be no damage; at worst I would need a tow for my engine dying when I cut the throttle; and if I could not make the field; then emergency services on the field would not be helpful. I kept the gear purposely up until I knew I could glide to the field without power to increase my glide range as much as possible. Once I had the field with a power off glide; I dropped the gear and cut the throttle once fully extended expecting the engine to choke off completely as it had choked with trying to adjust it back during descent. This did not happen and I was able to taxi off the runway with engine running near idle speeds without any rough sounds. Maintenance was available and they were very helpful to me. I explained what happened and emergency services got my information. The mechanic started up the aircraft normally and everything operated normally except once; he experienced the same symptoms I had; but only once. We looked over the fuel system and power quadrant connections; then he snaked the fuel tank vents and there were obstructions on both sides. There was a piece of plastic in the right fuel vent and a bug nest in the left fuel vent beyond were it could be seen by visible inspection; only found when the mechanic snaked the vents. After this he recommended I test it out; so I flew a close pattern several times with normal function of everything. I then completed my trip to ZZZ VFR with flight following; but lost contact as I had to remain under 1500 ft for cloud cover on the way home. There were no further engine issues suggesting that the symptoms were indeed due to obstructed fuel tank vents. What could have prevented this from happening is if: #1 I knew that the piece of plastic visible in the right vent had not been part of the vent system; I could have had it removed; and #2 if I had known how to or thought to snake the fuel tank vents on my own as preventative maintenance; I could have found any nests or obstructions; because most of the vent in not visible to preflight inspection; this is likely a common problem; yet I have never seen; heard of; or experienced it before. I believe I have a good understanding of engine and fuel systems; but somehow the simple vent issues were not even part of my thought process when I experienced this problem. #3 if there were vent covers for when the aircraft is outside (I intend to make my own plugs for when the aircraft sits outside for long). Rockwell Commander 114 pilot reported a loss of engine power and diversion due to obstruction in the fuel tank vent system.