fix(honcho): normalize legacy recallMode values like 'auto' to 'hybrid'

This commit is contained in:
Erosika
2026-03-12 16:27:49 -04:00
parent 0aed9bfde1
commit 45d3e83ad1
2 changed files with 13 additions and 2 deletions

View File

@@ -151,7 +151,8 @@ def cmd_setup(args) -> None:
hermes_host["writeFrequency"] = new_wf if new_wf in ("async", "turn", "session") else "async"
# Recall mode
current_recall = hermes_host.get("recallMode") or cfg.get("recallMode", "hybrid")
_raw_recall = hermes_host.get("recallMode") or cfg.get("recallMode", "hybrid")
current_recall = "hybrid" if _raw_recall not in ("hybrid", "context", "tools") else _raw_recall
print(f"\n Recall mode options:")
print(" hybrid — auto-injected context + Honcho tools available (default)")
print(" context — auto-injected context only, Honcho tools hidden")

View File

@@ -27,6 +27,16 @@ GLOBAL_CONFIG_PATH = Path.home() / ".honcho" / "config.json"
HOST = "hermes"
_RECALL_MODE_ALIASES = {"auto": "hybrid"}
_VALID_RECALL_MODES = {"hybrid", "context", "tools"}
def _normalize_recall_mode(val: str) -> str:
"""Normalize legacy recall mode values (e.g. 'auto''hybrid')."""
val = _RECALL_MODE_ALIASES.get(val, val)
return val if val in _VALID_RECALL_MODES else "hybrid"
def _resolve_memory_mode(
global_val: str | dict,
host_val: str | dict | None,
@@ -222,7 +232,7 @@ class HonchoClientConfig:
or raw.get("dialecticMaxChars")
or 600
),
recall_mode=(
recall_mode=_normalize_recall_mode(
host_block.get("recallMode")
or raw.get("recallMode")
or "hybrid"