From d21913b09cce330586efa89e08ab58e8624cc6bb Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Sat, 12 Sep 2026 18:40:20 -0700 Subject: [PATCH] fix(state): let sqlite raise the canonical error for a directory db_path The owner-only pre-create helper ran before sqlite3.connect() and turned a directory-as-state.db misconfiguration into IsADirectoryError instead of the sqlite OperationalError the open path (and its lock-patience classifier) expects. A directory leaks no row data, so skip it and let sqlite fail canonically. Also map the salvage carry-commit author email for the attribution gate. --- contributors/emails/hermes-fleet-fix@localhost | 1 + hermes_state.py | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 contributors/emails/hermes-fleet-fix@localhost diff --git a/contributors/emails/hermes-fleet-fix@localhost b/contributors/emails/hermes-fleet-fix@localhost new file mode 100644 index 0000000000..183f2f3651 --- /dev/null +++ b/contributors/emails/hermes-fleet-fix@localhost @@ -0,0 +1 @@ +rohitsabu diff --git a/hermes_state.py b/hermes_state.py index 2f9d621303..8bec8e91f1 100644 --- a/hermes_state.py +++ b/hermes_state.py @@ -248,6 +248,10 @@ def _secure_state_db_files(db_path: Path, *, create_main: bool = False) -> None: fd = os.open(path, flags, 0o600) except FileNotFoundError: continue + except IsADirectoryError: + # Not a database file at all; sqlite3.connect() raises the + # canonical error for this, and a directory leaks no row data. + continue try: os.fchmod(fd, 0o600) finally: