fix: guard atomic writers after profile deletion

This commit is contained in:
KoNit-K
2026-09-16 12:34:46 +08:00
committed by Teknium
parent 81140e4546
commit 91a38622db
3 changed files with 56 additions and 5 deletions
+2 -1
View File
@@ -103,8 +103,9 @@ def _write_json_cache(path: Path, data: Any, **dump_kwargs: Any) -> None:
"""Atomically persist a cache file (creating parents). Raises on failure — callers decide
whether a failed cache write is worth logging."""
from utils import atomic_json_write
from hermes_constants import mkdir_under_hermes_home
path.parent.mkdir(parents=True, exist_ok=True)
mkdir_under_hermes_home(path.parent)
atomic_json_write(path, data, **dump_kwargs)