Text this: International environmental agreements under endogenous uncertainty