From 0ede483479d62b56e1624dd72f2de6f402642283 Mon Sep 17 00:00:00 2001 From: Erosika Date: Tue, 8 Sep 2026 16:12:22 -0400 Subject: [PATCH] fix(honcho): clone sessionAiPeerPrefix into new profile host blocks clone_honcho_for_profile copied sessionPeerPrefix but not sessionAiPeerPrefix. A new profile cloned from a default block with the AI prefix on fell back to unprefixed session names and collided with the default profile's gateway sessions. --- plugins/memory/honcho/cli.py | 2 +- tests/honcho_plugin/test_cli.py | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/plugins/memory/honcho/cli.py b/plugins/memory/honcho/cli.py index e9c9c500e6..22281c24ef 100644 --- a/plugins/memory/honcho/cli.py +++ b/plugins/memory/honcho/cli.py @@ -25,7 +25,7 @@ _INHERITED_KEYS = ( "recallSync", ) # clone_honcho_for_profile also carries the operator's runtime-to-peer routing intent. -_CLONE_KEYS = _INHERITED_KEYS[:3] + ("sessionPeerPrefix",) + _INHERITED_KEYS[3:] + ( +_CLONE_KEYS = _INHERITED_KEYS[:3] + ("sessionPeerPrefix", "sessionAiPeerPrefix") + _INHERITED_KEYS[3:] + ( "pinUserPeer", "userPeerAliases", "runtimePeerPrefix", ) _IDENTITY_MAPPING_KEYS = ("pinPeerName", "pinUserPeer", "userPeerAliases", "runtimePeerPrefix") diff --git a/tests/honcho_plugin/test_cli.py b/tests/honcho_plugin/test_cli.py index 25d8380b08..a66a157491 100644 --- a/tests/honcho_plugin/test_cli.py +++ b/tests/honcho_plugin/test_cli.py @@ -275,6 +275,22 @@ class TestCloneHonchoForProfile: new_block = written["cfg"]["hosts"]["hermes_coder"] assert new_block["runtimePeerPrefix"] == "telegram_" + def test_session_ai_peer_prefix_carries_into_cloned_profile(self, monkeypatch, tmp_path): + cfg = { + "apiKey": "***", + "hosts": { + "hermes": { + "sessionAiPeerPrefix": True, + "peerName": "eri", + }, + }, + } + honcho_cli, written = self._setup_clone_env(monkeypatch, tmp_path, cfg) + ok = honcho_cli.clone_honcho_for_profile("coder") + assert ok is True + new_block = written["cfg"]["hosts"]["hermes_coder"] + assert new_block["sessionAiPeerPrefix"] is True + def test_legacy_pin_peer_name_migrates_to_canonical_on_clone(self, monkeypatch, tmp_path): cfg = { "apiKey": "***",