Trump's rhetoric was all bluster, he actually had no leverage and was unwilling to pay the cost to continue the war (mostly in terms of cost to himself). He needed an offramp and this was it.