I've been trying to wrap my head around why this is happening (without looking at the code). I've tried switching the workshops to all different types of options, changing the surrounding towns' workshops, buying all the trade & food items at both Odokh and Akkalat, and buying all the trade & food items at surrounding towns and selling them to Odokh and Akkalat, but nothing seemed to work.
I then noticed both Odokh and Akkalat had about 1000 sumpter horses and 1000 mules at each town. So I bought those and then slaughtered them all. I sold the meat back to each town. This immediately cleared up the caravan ping-ponging! I think there's an issue where both towns have extremely similar village production, i.e. sheep, horses, clay, and ore. (actually most of the Khuzait towns produce these things...) But especially the horses. There is so much sumpter and mule production in Calradia that thousands can accumulate at horse-producing towns. Maybe the caravans have trouble with this because they want to buy pack animals and horses for profit at both towns.