fix: change session_strategy default from per-directory to per-session

Matches Hermes' native session naming (title if set, otherwise
session-scoped). Not a breaking change -- no memory data is lost,
old sessions remain in Honcho.
This commit is contained in:
Erosika
2026-03-11 15:42:35 -04:00
parent a0b0dbe6b2
commit d987ff54a1
3 changed files with 8 additions and 8 deletions

View File

@@ -157,11 +157,11 @@ def cmd_setup(args) -> None:
cfg["recallMode"] = new_recall
# Session strategy
current_strat = cfg.get("sessionStrategy", "per-directory")
current_strat = cfg.get("sessionStrategy", "per-session")
print(f"\n Session strategy options:")
print(" per-directory — one session per working directory (default)")
print(" per-session — new Honcho session each run, named by Hermes session ID (default)")
print(" per-directory — one session per working directory")
print(" per-repo — one session per git repository (uses repo root name)")
print(" per-session — new Honcho session each run, named by Hermes session ID")
print(" global — single session across all directories")
new_strat = _prompt("Session strategy", default=current_strat)
if new_strat in ("per-session", "per-repo", "per-directory", "global"):
@@ -715,7 +715,7 @@ def cmd_migrate(args) -> None:
print()
print(" Session naming")
print(" OpenClaw: no persistent session concept — files are global.")
print(" Hermes: per-directory by default — each project gets its own session")
print(" Hermes: per-session by default — each run gets its own session")
print(" Map a custom name: hermes honcho map <session-name>")
# ── Step 6: Next steps ────────────────────────────────────────────────────

View File

@@ -95,7 +95,7 @@ class HonchoClientConfig:
# "tools" — no pre-loaded context, rely on tool calls only
recall_mode: str = "hybrid"
# Session resolution
session_strategy: str = "per-directory"
session_strategy: str = "per-session"
session_peer_prefix: bool = False
sessions: dict[str, str] = field(default_factory=dict)
# Raw global config for anything else consumers need
@@ -201,7 +201,7 @@ class HonchoClientConfig:
or raw.get("recallMode")
or "hybrid"
),
session_strategy=raw.get("sessionStrategy", "per-directory"),
session_strategy=raw.get("sessionStrategy", "per-session"),
session_peer_prefix=raw.get("sessionPeerPrefix", False),
sessions=raw.get("sessions", {}),
raw=raw,

View File

@@ -25,7 +25,7 @@ class TestHonchoClientConfigDefaults:
assert config.environment == "production"
assert config.enabled is False
assert config.save_messages is True
assert config.session_strategy == "per-directory"
assert config.session_strategy == "per-session"
assert config.recall_mode == "hybrid"
assert config.session_peer_prefix is False
assert config.linked_hosts == []
@@ -140,7 +140,7 @@ class TestFromGlobalConfig:
config_file = tmp_path / "config.json"
config_file.write_text(json.dumps({"apiKey": "key"}))
config = HonchoClientConfig.from_global_config(config_path=config_file)
assert config.session_strategy == "per-directory"
assert config.session_strategy == "per-session"
def test_context_tokens_host_block_wins(self, tmp_path):
"""Host block contextTokens should override root."""