That's the trouble with those international treaties and conventions. We're the only ones who adhere to them and it seems like we're the only ones expected to by other countries. I think we should revise everyone of them to include lines that say we only honor treaties and conventions that are honored by other countries. Like the Geneva convention. I can't think of one war or conflict we were in where the other side honored it.
Treaties typically include information on how to withdraw. Also under Customary international law if one party is violating a treaty the other can put the violator on notice and then leave the treaty if behavior does not change. That is what the Trump Admin did with Iran.
The last enemy that followed the then current laws of war when fighting the US was the German army (not the SS, the army) in WWII.