From 0a62610f10cc34d696b2239b2c69fa1ba0f1ca63 Mon Sep 17 00:00:00 2001 From: kshitijk4poor <82637225+kshitijk4poor@users.noreply.github.com> Date: Sun, 2 Aug 2026 14:50:19 +0530 Subject: [PATCH] fix(cli): swallow fsync errors in the openclaw EXDEV fallback Exact parity with utils.atomic_replace: its target fsync is wrapped in try/except OSError. A failed fsync after a successful copy must not surface the already-completed write as an error (Windows can raise on fsync of a read-only handle). --- .../scripts/openclaw_to_hermes.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/optional-skills/migration/openclaw-migration/scripts/openclaw_to_hermes.py b/optional-skills/migration/openclaw-migration/scripts/openclaw_to_hermes.py index 199ce94a0f..098a6cc51c 100644 --- a/optional-skills/migration/openclaw-migration/scripts/openclaw_to_hermes.py +++ b/optional-skills/migration/openclaw-migration/scripts/openclaw_to_hermes.py @@ -444,12 +444,17 @@ def dump_yaml_file(path: Path, data: Dict[str, Any]) -> None: except OSError: pass # fsync the copied target so the durability claim holds on the - # cross-device path too (mirrors utils.atomic_replace). - target_fd = os.open(target, os.O_RDONLY) + # cross-device path too (mirrors utils.atomic_replace, including + # its swallow — a failed fsync must not report the already-copied + # write as failed). try: - os.fsync(target_fd) - finally: - os.close(target_fd) + target_fd = os.open(target, os.O_RDONLY) + try: + os.fsync(target_fd) + finally: + os.close(target_fd) + except OSError: + pass os.unlink(tmp_path) except BaseException: try: