COP29 has produced a new global finance deal against considerable odds