From cd268c1226c9fcacfebbecb611c3bafd3cf66515 Mon Sep 17 00:00:00 2001 From: Hermes Pi Date: Fri, 10 Jul 2026 00:27:13 +0200 Subject: [PATCH] fix(honcho): read base_url and defaultHost from honcho.json host blocks Fixes Honcho client initialization for setup-generated configs that store connection details in a named host block (e.g. "local"). Previously: - base_url was only read from flat config root, not from host_block. - resolve_active_host() ignored defaultHost and always used the Hermes profile key ("hermes"), so the host block lookup returned {} and the api_key was also lost. Fixes NousResearch/hermes-agent#61661 --- plugins/memory/honcho/client.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/plugins/memory/honcho/client.py b/plugins/memory/honcho/client.py index abeb4fea48b1..ca4352f27aff 100644 --- a/plugins/memory/honcho/client.py +++ b/plugins/memory/honcho/client.py @@ -63,6 +63,19 @@ def resolve_active_host() -> str: if explicit: return explicit + # Respect defaultHost from honcho.json when no profile override is set. + # This keeps setup-generated configs (e.g. host block "local") in sync with + # the host key the rest of the plugin resolves. + try: + path = resolve_config_path() + if path.exists(): + raw = json.loads(path.read_text(encoding="utf-8")) + default_host = raw.get("defaultHost", "").strip() + if default_host: + return default_host + except Exception: + pass + try: from hermes_cli.profiles import get_active_profile_name profile = get_active_profile_name() @@ -477,7 +490,9 @@ class HonchoClientConfig: ) base_url = ( - raw.get("baseUrl") + host_block.get("baseUrl") + or host_block.get("base_url") + or raw.get("baseUrl") or raw.get("base_url") or os.environ.get("HONCHO_BASE_URL", "").strip() or None