diff --git a/cron/jobs.py b/cron/jobs.py index 6b9fd2754..117ccbde3 100644 --- a/cron/jobs.py +++ b/cron/jobs.py @@ -24,7 +24,7 @@ except ImportError: # Configuration # ============================================================================= -HERMES_DIR = Path.home() / ".hermes" +HERMES_DIR = Path(os.getenv("HERMES_HOME", Path.home() / ".hermes")) CRON_DIR = HERMES_DIR / "cron" JOBS_FILE = CRON_DIR / "jobs.json" OUTPUT_DIR = CRON_DIR / "output" diff --git a/gateway/run.py b/gateway/run.py index 59f74b39b..d70d24463 100644 --- a/gateway/run.py +++ b/gateway/run.py @@ -1811,6 +1811,7 @@ class GatewayRunner: Platform.DISCORD: "hermes-discord", Platform.WHATSAPP: "hermes-whatsapp", Platform.SLACK: "hermes-slack", + Platform.HOMEASSISTANT: "hermes-homeassistant", } # Try to load platform_toolsets from config @@ -1832,6 +1833,7 @@ class GatewayRunner: Platform.DISCORD: "discord", Platform.WHATSAPP: "whatsapp", Platform.SLACK: "slack", + Platform.HOMEASSISTANT: "homeassistant", }.get(source.platform, "telegram") # Use config override if present (list of toolsets), otherwise hardcoded default diff --git a/tools/environments/daytona.py b/tools/environments/daytona.py index c8df198c1..11efa7c08 100644 --- a/tools/environments/daytona.py +++ b/tools/environments/daytona.py @@ -6,6 +6,7 @@ and resumed on next creation, preserving the filesystem across sessions. """ import logging +import time import math import shlex import threading @@ -142,10 +143,9 @@ class DaytonaEnvironment(BaseEnvironment): t = threading.Thread(target=_run, daemon=True) t.start() # Wait for timeout + generous buffer for network/SDK overhead - deadline = timeout + 10 + deadline = time.monotonic() + timeout + 10 while t.is_alive(): t.join(timeout=0.2) - deadline -= 0.2 if is_interrupted(): with self._lock: try: @@ -156,7 +156,7 @@ class DaytonaEnvironment(BaseEnvironment): "output": "[Command interrupted - Daytona sandbox stopped]", "returncode": 130, } - if deadline <= 0: + if time.monotonic() > deadline: # Shell timeout didn't fire and SDK is hung — force stop with self._lock: try: