The following changes were made by the replace_file_content tool to: /root/MayaXSenderbot/bridge.py. If relevant, proactively run terminal commands to execute this code for the USER. Don't ask for permission. [diff_block_start] @@ -118,10 +118,18 @@ def atomic_write_json(path: Path, payload: dict[str, Any]) -> None: path.parent.mkdir(parents=True, exist_ok=True) - tmp = path.with_suffix(path.suffix + ".tmp") - with open(tmp, "w", encoding="utf-8") as f: - json.dump(payload, f, indent=2, ensure_ascii=False) - os.replace(tmp, path) + tmp = path.with_name(f"{path.name}.{os.getpid()}_{uuid.uuid4().hex[:8]}.tmp") + try: + with open(tmp, "w", encoding="utf-8") as f: + json.dump(payload, f, indent=2, ensure_ascii=False) + os.replace(tmp, path) + except Exception: + if tmp.exists(): + try: + tmp.unlink() + except Exception: + pass + raise def load_json(path: Path) -> dict[str, Any]: [diff_block_end] Please note that the above snippet only shows the MODIFIED lines from the last change. It shows up to 3 lines of unchanged lines before and after the modified lines. The actual file contents may have many more lines not shown.