fix: route stray HERMES_HOME hardcodes through get_hermes_home() (profile + native-Windows safety)
This commit is contained in:
+9
-17
@@ -62,11 +62,9 @@ except ImportError:
|
||||
|
||||
def _get_sessions_dir() -> Path:
|
||||
"""Return the sessions directory using HERMES_HOME."""
|
||||
try:
|
||||
from hermes_constants import get_hermes_home
|
||||
return get_hermes_home() / "sessions"
|
||||
except ImportError:
|
||||
return Path(os.environ.get("HERMES_HOME", Path.home() / ".hermes")) / "sessions"
|
||||
from hermes_constants import get_hermes_home
|
||||
|
||||
return get_hermes_home() / "sessions"
|
||||
|
||||
|
||||
def _get_session_db():
|
||||
@@ -194,13 +192,9 @@ def _load_sessions_index_from_json() -> dict:
|
||||
|
||||
def _load_channel_directory() -> dict:
|
||||
"""Load the cached channel directory for available targets."""
|
||||
try:
|
||||
from hermes_constants import get_hermes_home
|
||||
directory_file = get_hermes_home() / "channel_directory.json"
|
||||
except ImportError:
|
||||
directory_file = Path(
|
||||
os.environ.get("HERMES_HOME", Path.home() / ".hermes")
|
||||
) / "channel_directory.json"
|
||||
from hermes_constants import get_hermes_home
|
||||
|
||||
directory_file = get_hermes_home() / "channel_directory.json"
|
||||
|
||||
if not directory_file.exists():
|
||||
return {}
|
||||
@@ -450,11 +444,9 @@ class EventBridge:
|
||||
eliminating the old dual-file (sessions.json + state.db) race that
|
||||
could drop brand-new conversations (#8925).
|
||||
"""
|
||||
try:
|
||||
from hermes_constants import get_hermes_home
|
||||
db_file = get_hermes_home() / "state.db"
|
||||
except ImportError:
|
||||
db_file = Path(os.environ.get("HERMES_HOME", Path.home() / ".hermes")) / "state.db"
|
||||
from hermes_constants import get_hermes_home
|
||||
|
||||
db_file = get_hermes_home() / "state.db"
|
||||
|
||||
try:
|
||||
db_mtime = db_file.stat().st_mtime if db_file.exists() else 0.0
|
||||
|
||||
Reference in New Issue
Block a user