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.
This commit is contained in:
@@ -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")
|
||||
|
||||
@@ -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": "***",
|
||||
|
||||
Reference in New Issue
Block a user