The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
refactor(config): gateway and xAI migration use the seam's path helpers
kshitijk4poorb4a39efe8cf9
diff --git a/gateway/config_loader.py b/gateway/config_loader.pyindex 4081ff1c644..26832e61638 100644--- a/gateway/config_loader.py+++ b/gateway/config_loader.py@@ -493,12 +493,12 @@ def read_yaml_layers(home: Path) -> dict:(``gateway.relay.relay_explicitly_disabled``) reads through here so it cannot disagree with``load_gateway_config()`` on which files count."""- from hermes_cli.config_backend import get_config_backend+ from hermes_cli.config_backend import config_exists, read_config_doc- backend = get_config_backend()+ config_path = Path(home) / "config.yaml"yaml_cfg: dict = {}- if backend.exists(home):- yaml_cfg = backend.read_user_layer(home).doc or {}+ if config_exists(config_path):+ yaml_cfg = read_config_doc(config_path) or {}from hermes_cli.config import _expand_env_varsdiff --git a/hermes_cli/xai_retirement.py b/hermes_cli/xai_retirement.pyindex 8b62aeccbfa..43a2837f64c 100644--- a/hermes_cli/xai_retirement.py+++ b/hermes_cli/xai_retirement.py@@ -131,11 +131,9 @@ def apply_migration(Unless ``backup=False`` a copy goes to ``backups/config/`` (reason ``pre-migrate-xai``)."""from ruamel.yaml import YAML # local import — avoid hard dep at module load- from hermes_cli.config_backend import ConfigBackendUnavailable, supports_file_tooling- if not supports_file_tooling():- # A type-literal-preserving rewrite of the file itself; a non-file backend has no file.- raise ConfigBackendUnavailable("the xAI model migration rewrites the local config.yaml, and "- "this config backend has none")+ from hermes_cli.config_backend import require_file_tooling+ # A type-literal-preserving rewrite of the file itself; a non-file backend has no file.+ require_file_tooling("The xAI model migration")config_path = Path(config_path)if not config_path.exists(): # config-reader: ok — file tooling, gated on supports_file_tooling()raise FileNotFoundError(config_path)