The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(config-remote): the poll interval is a constant, not a HERMES_* env var
Ben Barclayf292c4c35742
diff --git a/plugins/config_backends/remote/backend.py b/plugins/config_backends/remote/backend.pyindex 8e96b7e64d9..cc6542dc825 100644--- a/plugins/config_backends/remote/backend.py+++ b/plugins/config_backends/remote/backend.py@@ -34,19 +34,14 @@ from .values import secret_literal_path, to_wirelogger = logging.getLogger(__name__)-POLL_ENV = "HERMES_CONFIG_REMOTE_POLL_SECONDS"-DEFAULT_POLL_SECONDS = 300.0+POLL_SECONDS = 300.0 # contract §11.3; a plane-served interval is a later changeMIN_POLL_SECONDS = 30.0 # contract §11.3: lower values are clampedBOOT_RETRY_DELAYS = (10.0, 20.0) # contract §11.4: attempts at t = 0, ~10 s, ~30 sMAX_RETRY_WAIT = 20.0def poll_interval() -> float:- try:- value = float(os.environ.get(POLL_ENV, "") or DEFAULT_POLL_SECONDS)- except ValueError:- value = DEFAULT_POLL_SECONDS- return max(value, MIN_POLL_SECONDS)+ return max(POLL_SECONDS, MIN_POLL_SECONDS)def _latest_config_version() -> int:@@ -736,10 +731,10 @@ class RemoteBackend:def deployment_env_names(self) -> frozenset:from hermes_cli.config_backend import BACKEND_ENV- return frozenset({BACKEND_ENV, client.URL_ENV, client.INSTANCE_ENV, POLL_ENV})+ return frozenset({BACKEND_ENV, client.URL_ENV, client.INSTANCE_ENV})def bootstrap_env_names(self) -> frozenset:- return PLANE_CREDENTIAL_ENV_NAMES | {POLL_ENV} # the deployment (selector, plane, instance) and the credential+ return PLANE_CREDENTIAL_ENV_NAMES # the deployment (selector, plane, instance) and the credential@contextlib.contextmanagerdef preserve_read_base(self):diff --git a/tests/plugins/config_backends/test_remote_backend.py b/tests/plugins/config_backends/test_remote_backend.pyindex addb6389037..f57b1040bf9 100644--- a/tests/plugins/config_backends/test_remote_backend.py+++ b/tests/plugins/config_backends/test_remote_backend.py@@ -364,11 +364,15 @@ def test_forked_child_rearms_its_poller(plane):assert backend._poller is not None and backend._poller.is_alive()-def test_poll_interval_floor(monkeypatch):- monkeypatch.setenv("HERMES_CONFIG_REMOTE_POLL_SECONDS", "1")- assert backend_mod.poll_interval() == backend_mod.MIN_POLL_SECONDS- monkeypatch.setenv("HERMES_CONFIG_REMOTE_POLL_SECONDS", "600")- assert backend_mod.poll_interval() == 600+def test_poll_interval_is_a_constant_no_env_tunes(monkeypatch):+ # teknium1 P2-2: no non-secret HERMES_* env var for the interval; 300 s, clamped at 30 s.+ for value in ("1", "600"):+ monkeypatch.setenv("HERMES_CONFIG_REMOTE_POLL_SECONDS", value)+ assert backend_mod.poll_interval() == 300.0+ assert backend_mod.MIN_POLL_SECONDS == 30.0+ backend = backend_mod.RemoteBackend()+ names = backend.bootstrap_env_names() | backend.deployment_env_names() | backend.protected_env_names()+ assert not any("POLL" in n for n in names)def test_named_profile_fetches_its_own_layer(plane):diff --git a/website/docs/reference/environment-variables.md b/website/docs/reference/environment-variables.mdindex e805642b719..736aeba849a 100644--- a/website/docs/reference/environment-variables.md+++ b/website/docs/reference/environment-variables.md@@ -120,6 +120,8 @@ Hermes reads environment variables from the process environment and, for user-ma| `HERMES_LOCAL_STT_LANGUAGE` | Default language hint for STT. Used by the `local` (faster-whisper) provider, `HERMES_LOCAL_STT_COMMAND`, the local `whisper` CLI fallback (default: `en`), Groq, and xAI when no per-provider `language` is set in `config.yaml` || `HERMES_HOME` | Select the configuration and user-data home. A literal `~` or `$VAR` in the value is expanded (fish does not expand `~` inside `VAR=~/…`), so it never resolves relative to the current directory. Defaults to `~/.hermes` on POSIX and `%LOCALAPPDATA%\hermes` on Windows; the official Docker image uses `/opt/data`. Profile/runtime context can select a more specific home. || `HERMES_CONFIG_BACKEND` | Select where the profile's `config.yaml` user layer is read and written. `file` (the default) is the local `config.yaml`; `remote` is [Remote Config](../user-guide/remote-config.md). Any other value, or a remote backend that cannot serve config, stops Hermes at startup with an error instead of falling back to defaults. An explicitly empty value in a `.env` resets a stale shell value to `file`. Read from the launch environment, the launch home's `.env` and the managed `.env`, never from `config.yaml`. See [Config backend](../developer-guide/config-backend.md). |+| `HERMES_CONFIG_REMOTE_URL` | Base URL of the [Remote Config](../user-guide/remote-config.md) plane (default `https://config-config.nousresearch.com`; `https://` only, plain `http://` only to loopback, no user info). An env var because it is needed before any config can be read: it says where config comes from. |+| `HERMES_CONFIG_INSTANCE_ID` | This agent's id in the [Remote Config](../user-guide/remote-config.md) plane; required with `HERMES_CONFIG_BACKEND=remote`. An env var because the plane needs it to serve the first config read. || `HERMES_DISABLE_WINDOWS_UTF8` | **Windows only.** Set to `1` to disable the UTF-8 stdio shim (`configure_windows_stdio()`) and fall back to the console's locale code page. Useful for bisecting encoding bugs; rarely the right setting in normal operation || `HERMES_KANBAN_HOME` | Override the shared Hermes root that anchors the kanban board (db + workspaces + worker logs). Falls back to `get_default_hermes_root()` (the parent of any active profile). Useful for tests and unusual deployments || `HERMES_KANBAN_BOARD` | Pin the active kanban board for this process. Takes precedence over `~/.hermes/kanban/current`; the dispatcher injects this into worker subprocess env so workers physically cannot see tasks on other boards. Defaults to `default`. Slug validation: lowercase alphanumerics + hyphens + underscores, 1-64 chars |diff --git a/website/docs/user-guide/remote-config.md b/website/docs/user-guide/remote-config.mdindex ff1ec75e089..33194e5cf05 100644--- a/website/docs/user-guide/remote-config.md+++ b/website/docs/user-guide/remote-config.md@@ -26,7 +26,6 @@ cannot select the backend, because the backend is what serves config.| `HERMES_CONFIG_BACKEND=remote` | Use the config plane instead of `config.yaml` (default `file`). || `HERMES_CONFIG_INSTANCE_ID` | This agent's id in the plane. Hermes Cloud sets it; on-prem the operator sets it when registering the agent. Required. || `HERMES_CONFIG_REMOTE_URL` | The plane's base URL (default `https://config-config.nousresearch.com`). |-| `HERMES_CONFIG_REMOTE_POLL_SECONDS` | How often each process checks for changes (default `300`, minimum `30`). |The agent authenticates as itself:@@ -64,9 +63,9 @@ exits with an error rather than read a local file.there is no local cache. A running process keeps the config it last fetchedin memory. If the plane becomes unreachable while Hermes runs, the processkeeps its in-memory config and retries on the next poll.-- **Changes arrive by polling.** Each process checks for changes every- `HERMES_CONFIG_REMOTE_POLL_SECONDS`. A change made in the plane reaches a- running agent within one interval.+- **Changes arrive by polling.** Each process checks for changes every 5+ minutes. A change made in the plane reaches a running agent within one+ interval.- **Writes go to the profile's own level.** `hermes config set`, `/model`,the dashboard, and every other config writer send only the keys that changed,guarded against concurrent edits. If another process changed the profile