From f49eebf24452d238d1029dbf8f5dc7773320bfdb Mon Sep 17 00:00:00 2001 From: Teknium Date: Tue, 31 Mar 2026 00:28:26 -0700 Subject: [PATCH] fix(memory): only auto-migrate Honcho when enabled + credentialed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Check HonchoClientConfig.enabled AND (api_key OR base_url) before auto-migrating — not just file existence. Prevents false activation for users who disabled Honcho, stopped using it (config lingers), or have ~/.honcho/ from a different tool. --- run_agent.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/run_agent.py b/run_agent.py index c65b436b85..c6ef22e59a 100644 --- a/run_agent.py +++ b/run_agent.py @@ -1020,17 +1020,16 @@ class AIAgent: try: _mem_provider_name = mem_config.get("provider", "") if mem_config else "" - # Auto-migrate: if Honcho was configured but memory.provider - # is not set, activate the honcho plugin automatically. - # The plugin reads the same config files — zero data loss. + # Auto-migrate: if Honcho was actively configured (enabled + + # credentials) but memory.provider is not set, activate the + # honcho plugin automatically. Just having the config file + # is not enough — the user may have disabled Honcho or the + # file may be from a different tool. if not _mem_provider_name: try: - from hermes_constants import get_hermes_home as _ghh2 - _honcho_paths = [ - _ghh2() / "honcho.json", - Path.home() / ".honcho" / "config.json", - ] - if any(p.exists() for p in _honcho_paths): + from honcho_integration.client import HonchoClientConfig as _HCC + _hcfg = _HCC.from_global_config() + if _hcfg.enabled and (_hcfg.api_key or _hcfg.base_url): _mem_provider_name = "honcho" # Persist so this only auto-migrates once try: