At climate talks, painstaking diplomacy and then anger