I went to a lecture by a professor at Oregon State University where he discussed research into bipedal walking, and described much the same problem and how you solve it. Namely, how do you adjust to changing terrain and payloads.
One of the take-aways from that lecture (and this is my naïveté showing) was that their research (that later produced the “Cassie” robot and the company Agility Robotics) was you can either mimic nature and how animals walk, or you can do it like Boston Dynamics and “Brute Force it”