The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(honcho): bust gateway agent cache on session-prefix flips
Eli Robbins55dfb517e4da
diff --git a/plugins/memory/honcho/__init__.py b/plugins/memory/honcho/__init__.pyindex 1b68a33c664..0b966be1c7d 100644--- a/plugins/memory/honcho/__init__.py+++ b/plugins/memory/honcho/__init__.py@@ -703,7 +703,7 @@ class HonchoMemoryProvider(DialecticMixin, MemoryProvider):"pin_user_identity": bool(cfg.pin_peer_name),"runtime_identity_prefix": cfg.runtime_peer_prefix or "","user_identity_aliases": sorted(aliases.items()),- "session_prefixing": [bool(cfg.session_peer_prefix)],+ "session_prefixing": [bool(cfg.session_peer_prefix), bool(cfg.session_ai_peer_prefix)],"a2a_sessions": bool(cfg.a2a_sessions),}self._identity_signature_memo = {memo_key: values}diff --git a/tests/honcho_plugin/test_pin_peer_name.py b/tests/honcho_plugin/test_pin_peer_name.pyindex 1f910e9c5d6..d6ee3f2aa89 100644--- a/tests/honcho_plugin/test_pin_peer_name.py+++ b/tests/honcho_plugin/test_pin_peer_name.py@@ -551,6 +551,23 @@ class TestPinTransition:assert sig_unpinned["memory.pin_user_identity"] is Falseassert not any(k.startswith("honcho.") for k in sig_pinned)+ def test_identity_signature_reflects_both_session_prefixes(self, tmp_path, monkeypatch):+ """Flipping either session prefix mid-flight must invalidate the cached agent: both feed the+ ``resolve_session_name`` output frozen into the provider's ``_session_key`` at construction."""+ from plugins.memory.honcho import HonchoMemoryProvider++ cfg_path = tmp_path / "honcho.json"+ monkeypatch.setenv("HERMES_HOME", str(tmp_path))+ base = {"apiKey": "k", "peerName": "Igor", "aiPeer": "hermes"}+ provider = HonchoMemoryProvider()++ cfg_path.write_text(json.dumps({**base, "sessionPeerPrefix": True, "sessionAiPeerPrefix": False}))+ sig_user_only = provider.identity_signature()["session_prefixing"]+ cfg_path.write_text(json.dumps({**base, "sessionPeerPrefix": True, "sessionAiPeerPrefix": True}))+ sig_both = provider.identity_signature()["session_prefixing"]++ assert sig_user_only != sig_both+class TestProfilePeerUniqueness:"""Each Hermes profile can pin to its own unique peerName.