The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(config): drop the runtime read of the docs env registry
teknium1fd74bf6f58c8
diff --git a/hermes_cli/config_env_routing.py b/hermes_cli/config_env_routing.pyindex 139d0527d4e..826a7f32514 100644--- a/hermes_cli/config_env_routing.py+++ b/hermes_cli/config_env_routing.py@@ -17,7 +17,6 @@ lifecycle in ``hermes_cli.credential_lifecycle``.import reimport sys-from functools import lru_cachefrom pathlib import Pathfrom typing import Optional@@ -25,9 +24,6 @@ from typing import Optional# Case-sensitive on purpose: a lowercase bare name (``my_flag``) stays a config.yaml top-level key._ENV_SHAPE_RE = re.compile(r"^[A-Z][A-Z0-9_]*$")-_DOCS_REGISTRY = Path(__file__).resolve().parents[1] / "website" / "docs" / "reference" / "environment-variables.md"--def is_registered_env_name(name: str) -> bool:"""True when Hermes itself enumerates ``name``: ``OPTIONAL_ENV_VARS`` / ``_EXTRA_ENV_KEYS``, or aself-configuring platform suffix so plugin adapters nobody listed (``IRC_HOME_CHANNEL``) count."""@@ -45,26 +41,12 @@ def is_env_setting_key(key: str) -> bool:return bool(_ENV_SHAPE_RE.match(key)) or is_registered_env_name(key.upper())-@lru_cache(maxsize=1)-def _documented_env_names() -> Optional[frozenset]:- """Names in the environment-variable reference of a source checkout; None when the docs tree is- not installed alongside the package (then nothing can be said about an unregistered name)."""- try:- text = _DOCS_REGISTRY.read_text(encoding="utf-8")- except OSError:- return None- return frozenset(re.findall(r"`([A-Z][A-Z0-9_]*)`", text))--def unknown_env_name_note(key: str) -> Optional[str]:- """One-line heads-up when neither the code nor the documentation knows ``key``. The value is+ """One-line heads-up when Hermes itself does not enumerate ``key``. The value isstill exported to the process environment from ``.env``, so a plugin or skill may read it."""name = key.upper()if is_registered_env_name(name):return None- documented = _documented_env_names()- if documented is None or name in documented:- return Nonereturn (f" (note: Hermes does not read {name} itself; it is exported to the process environment ""from .env for plugins, skills and external tools)")