As the son of farmers (and thus a part-time farmer for most of my life), here's a bit of what I've learned so far:
Stay away from uncoated high carbon steel. I have had issues with CPM-M4 and ZDP-189 rusting and staining, and in the case of ZDP-189, pitting, due to the high acid content in certain products such as tomatoes and tomato plants.
If you're not using your knife as a substitute for another tool, then a full flat ground or high flat ground blade is the way to go, every time. I've found that farm work more often than not requires smooth, clean cuts, and a thicker blade will not make a clean cut through a thick piece of material.
If you use a locking folder, pick something with a lock that is easy (and safe) to disengage one-handed. Backlocks are a huge pain in the butt in this regard, especially as I find it diffficult to disengage them without my thumb or forefinger in the path of the closing blade. I also avoid opinels and many traditional knives thanks to the number of times I've cut myself trying to open or close them. Farming often involves sweaty hands, gloves, or a poor grip- better to find a knife that minimizes your chances of cutting yourself.
Finally, two knives might be the best solution- something more robust for farm work, and something with a thin blade stock for cutting fruits and vegetables.
To wrap up this somewhat rambling post, I can personally recommend two knives to you; the Spyderco drop point UK Penknife and the Benchmade Doug Ritter Griptilian. The UK Penknife features a slim and slicey blade made of CTS-BD1, which resists corrosion quite well, takes a decent enough edge, and can be easily touched up or resharpened. While it does not use a locking mechanism, its choil prevents it from closing on one's hand, and the lack of a lock makes it easy and safe to close. It is also supremely ergonomic and is an absolute wonder in terms of grip. I should also mention it's very easy to clean thanks to the lack of washers and entirely FRN handles- I just hit it with a hose, then shook out the excess water. No rust so far. As for downsides, it's a relatively thin blade, and it'll need fairly frequent touch-ups if it's being used to cut abrasive material.
The Doug Ritter Griptilian is supremely robust, utilizes (IMO) one of the most safe and user-friendly locks on the market, as well as an excellent grip, and a very tough blade. Its high flat grind makes it a reasonable slicer- not as great as the UK Penknife or an opinel/traditional design, but acceptable nonetheless. It's easy to open and close, and S30v/M390 are both great steels with excellent corrosion resistance.