Skip to content

The agent that grows with you

fix(backup): keep cache/generated in hermes backup archives

kshitijk4poor0ecc5c644a89
diff --git a/hermes_cli/backup.py b/hermes_cli/backup.py
index 66ad325be78..25dad5831d9 100644
--- a/hermes_cli/backup.py
+++ b/hermes_cli/backup.py
@@ -24,6 +24,7 @@ from hermes_constants import (
from hermes_state_dbfile import RETIRED_GENERATION_DIR_SUFFIX
from hermes_state_holders import read_only_db_uri
+from agent.provider_media import GENERATED_SUBDIR
from hermes_cli.archive_safe import normalize_archive_parts
from hermes_cli.backup_sqlite import _close_quietly, _safe_copy_db
from hermes_cli.home_data_layout import PM_RUNTIME_ROOT_DIRS, profile_root_entry
@@ -100,7 +101,8 @@ _EXCLUDED_BACKUP_ROOT_DIRS = frozenset({"browser_profiles"})
# profiles with locked SQLite, tool-output spill) with durable artifacts nothing can rebuild: media
# the gateway delivered to or received from the user (``gateway.platforms.base``'s media-delivery
# subdirs) and the grounded-citations evidence ledger. Only these subdirs are archived.
-_KEPT_CACHE_SUBDIRS = {"images", "audio", "videos", "documents", "screenshots", "citations"}
+_KEPT_CACHE_SUBDIRS = {
+ "images", "audio", "videos", "documents", "screenshots", "citations", GENERATED_SUBDIR}
def _in_excluded_root_dir(rel_path: Path) -> bool:
diff --git a/tests/hermes_cli/test_backup.py b/tests/hermes_cli/test_backup.py
index 6917fa0dbbe..6587379bfdf 100644
--- a/tests/hermes_cli/test_backup.py
+++ b/tests/hermes_cli/test_backup.py
@@ -277,6 +277,8 @@ class TestIterBackupFiles:
"cache/images/x.png": True,
"cache/citations/ledger.json": True,
"profiles/sage/cache/images/y.png": True,
+ "cache/generated/images/x.png": True,
+ "profiles/sage/cache/generated/videos/v.mp4": True,
"skills/example/cache/state.db": True,
}
for rel in files: