diff --git a/gateway/config.py b/gateway/config.py index d325abcde..ec7d2b5cc 100644 --- a/gateway/config.py +++ b/gateway/config.py @@ -83,10 +83,13 @@ class SessionResetPolicy: @classmethod def from_dict(cls, data: Dict[str, Any]) -> "SessionResetPolicy": + # Handle both missing keys and explicit null values (YAML null → None) + at_hour = data.get("at_hour") + idle_minutes = data.get("idle_minutes") return cls( mode=data.get("mode", "both"), - at_hour=data.get("at_hour", 4), - idle_minutes=data.get("idle_minutes", 1440), + at_hour=at_hour if at_hour is not None else 4, + idle_minutes=idle_minutes if idle_minutes is not None else 1440, ) diff --git a/run_agent.py b/run_agent.py index eafb590c1..5a69a3870 100644 --- a/run_agent.py +++ b/run_agent.py @@ -2729,7 +2729,7 @@ class AIAgent: "model": self.model, "messages": api_messages, "tools": self.tools if self.tools else None, - "timeout": 900.0, + "timeout": float(os.getenv("HERMES_API_TIMEOUT", 900.0)), } if self.max_tokens is not None: diff --git a/website/docs/reference/environment-variables.md b/website/docs/reference/environment-variables.md index 6dd8bb050..6cecf2ac6 100644 --- a/website/docs/reference/environment-variables.md +++ b/website/docs/reference/environment-variables.md @@ -131,6 +131,7 @@ All variables go in `~/.hermes/.env`. You can also set them with `hermes config | `HERMES_HUMAN_DELAY_MIN_MS` | Custom delay range minimum (ms) | | `HERMES_HUMAN_DELAY_MAX_MS` | Custom delay range maximum (ms) | | `HERMES_QUIET` | Suppress non-essential output (`true`/`false`) | +| `HERMES_API_TIMEOUT` | LLM API call timeout in seconds (default: `900`) | | `HERMES_EXEC_ASK` | Enable execution approval prompts in gateway mode (`true`/`false`) | ## Session Settings