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.
This commit is contained in:
Erosika
2026-09-08 16:11:25 -04:00
committed by kshitij
parent 841b768cd7
commit 0c92bf1614
+17
View File
@@ -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.