mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-28 06:51:16 +08:00
fix(memory): keep Honcho provider opt-in
This commit is contained in:
25
run_agent.py
25
run_agent.py
@@ -1306,31 +1306,6 @@ class AIAgent:
|
||||
try:
|
||||
_mem_provider_name = mem_config.get("provider", "") if mem_config else ""
|
||||
|
||||
# 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 plugins.memory.honcho.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:
|
||||
from hermes_cli.config import load_config as _lc, save_config as _sc
|
||||
_cfg = _lc()
|
||||
_cfg.setdefault("memory", {})["provider"] = "honcho"
|
||||
_sc(_cfg)
|
||||
except Exception:
|
||||
pass
|
||||
if not self.quiet_mode:
|
||||
print(" ✓ Auto-migrated Honcho to memory provider plugin.")
|
||||
print(" Your config and data are preserved.\n")
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
if _mem_provider_name:
|
||||
from agent.memory_manager import MemoryManager as _MemoryManager
|
||||
from plugins.memory import load_memory_provider as _load_mem
|
||||
|
||||
Reference in New Issue
Block a user