Today it happens (and my impression is that it is rather common) for a divorcing couple to write a civil divorce agreement with all the conditions of their divorce, and this agreement will contain a clause compelling the husband to actually give the divorce after the agreement is approved by the court. Not giving the divorce after this would carry some pretty severe civil penalties, even if no penalty is specified in the agreement.
Now, if someone has compelled themselves to give a divorce, they should be released from that commitment before writing the get lest it possibly be considered a get given under duress, Even HaEzer 134:4.
אם נשבע הבעל ליתן גט צריך שיתירו לו קודם שלא יהא דומה לאונס אך ערבות יתן אם ירצה שאין זה דומה לאונס: הגה וה"ה אם קבל קנין לגרש (פסקי מהרא"י סימן קע"ג) אבל אם קבל עליו קנסות אם לא יגרש לא מקרי אונס מאחר דתלה גיטו בדבר אחר ויכול ליתן הקנסות ולא לגרש (ב"י בשם תשובה וכן הוא במהרי"ק שם בפסקים) (ויש מחמירין אפי' בכה"ג שם בתשובת הרשב"א) וטוב לחוש לכתחילה ולפטרו מן הקנס אבל אם כבר גירש מפני זה ואפי' גירש מכח שבועה שעשה מעצמו לגרש הגט כשר. הואיל ומתחלה לא אנסוהו על כך (תשובת הריטב"א)
If the husband takes an oath to give a bill of divorce, they need to make him renounce it beforehand, in order that it not look like he is being compelled. But if it was just a pledge he made, he can give it if he wants, because this is not similar to being compelled. Rem''a: and this is the ruling if he receives an acquisition to divorce. But if he accepts fines if he does not divorce, this is not called compulsion, since his bill of divorce was dependent on another thing and he will be able to give the fine and not divorce. And there are those that are stringent even in a case like that. And it's better to worry a priori and exempt him from the fine. But if he already divorced(her) because of this, and even did so from the strength of the oath he made to divorce, the bill of divorce is kosher, since, from the outset, they did not compel him by this.
Now I understand the practical reasons why this is done, but I do not see how these considerations deal with this halacha. Please don't give answers which just explain the legal and social reality.
Are divorces given subsequent to such agreements being accepted by a court only kosher bidieved? Is there any psak given in modern times which addresses this?