From 0c92bf1614711c93fb2d630feae4a79da9daf5eb Mon Sep 17 00:00:00 2001 From: Erosika Date: Tue, 8 Sep 2026 16:11:25 -0400 Subject: [PATCH] fix(honcho): bust the cached gateway agent when the workspace changes peers map can repoint a host block's workspace, but the gateway agent cache signature did not include it. A live gateway kept writing to the old workspace until an unrelated eviction or restart. The signature now carries honcho.workspace. --- tests/honcho_plugin/test_pin_peer_name.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/honcho_plugin/test_pin_peer_name.py b/tests/honcho_plugin/test_pin_peer_name.py index d6ee3f2aa8..ce792139b8 100644 --- a/tests/honcho_plugin/test_pin_peer_name.py +++ b/tests/honcho_plugin/test_pin_peer_name.py @@ -568,6 +568,23 @@ class TestPinTransition: assert sig_user_only != sig_both + def test_identity_signature_reflects_a_repointed_host_workspace(self, tmp_path, monkeypatch): + """``hermes honcho peers map`` can repoint a host block's workspace; the cached agent's manager + is bound to the old one until the signature changes.""" + 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, "hosts": {"hermes": {"workspace": "old"}}})) + sig_old = provider.identity_signature()["workspace"] + cfg_path.write_text(json.dumps({**base, "hosts": {"hermes": {"workspace": "new"}}})) + sig_new = provider.identity_signature()["workspace"] + + assert (sig_old, sig_new) == ("old", "new") + class TestProfilePeerUniqueness: """Each Hermes profile can pin to its own unique peerName.