Background
PR #30077 added a Honcho-specific block to GatewayRunner._extract_cache_busting_config() so edits to honcho.json identity-mapping keys (peerName, aiPeer, pinPeerName/pinUserPeer, userPeerAliases, runtimePeerPrefix) bust the cached AIAgent on the next gateway message. This was needed because HonchoSessionManager freezes the resolved identity at first-message init — without busting on these key changes, mid-flight honcho.json edits go unread until an unrelated cache eviction.
The implementation works correctly, but it hardcodes a backwards dependency from gateway/run.py to plugins.memory.honcho.client.HonchoClientConfig:
https://github.com/NousResearch/hermes-agent/blob/main/gateway/run.py#L14677-L14695
try:
from plugins.memory.honcho.client import HonchoClientConfig
hcfg = HonchoClientConfig.from_global_config()
out["honcho.peer_name"] = hcfg.peer_name
...
Problem
-
Layering violation. Gateway code shouldn't know about specific memory-provider plugins by name. If mem0, supermemory, hindsight, or any future memory provider adds analogous identity-mapping config (which they plausibly will, given the per-user-peer pattern this PR established), each one would require another try/except: from plugins.memory.X import ... block in core gateway code.
-
Per-message disk I/O for everyone. HonchoClientConfig.from_global_config() does path.read_text() + json.loads() on every gateway message — including for users who don't run Honcho at all. The file is small so it's microseconds, but it's still unnecessary work on the hot path.
Proposed fix
Add a cache_busting_signature() -> dict | None hook to the MemoryProvider ABC (agent/memory_provider.py). Memory providers return a flat dict of provider_name.key -> value entries that should bust the cached agent when they change. The default implementation returns None (no busting).
Then in _extract_cache_busting_config, ask the active memory provider for its signature:
# Pseudocode — replace the honcho-specific block
active_memory = MemoryRegistry.get_active_provider(user_config)
if active_memory is not None:
extra = active_memory.cache_busting_signature() or {}
out.update(extra)
This also incidentally fixes the per-message disk read for non-Honcho users — only the active provider's hook runs.
Honcho's implementation moves to plugins/memory/honcho/__init__.py::HonchoMemoryProvider.cache_busting_signature() returning the same 5 keys it returns today.
Acceptance criteria
Context
Background
PR #30077 added a Honcho-specific block to
GatewayRunner._extract_cache_busting_config()so edits tohoncho.jsonidentity-mapping keys (peerName,aiPeer,pinPeerName/pinUserPeer,userPeerAliases,runtimePeerPrefix) bust the cachedAIAgenton the next gateway message. This was needed becauseHonchoSessionManagerfreezes the resolved identity at first-message init — without busting on these key changes, mid-flighthoncho.jsonedits go unread until an unrelated cache eviction.The implementation works correctly, but it hardcodes a backwards dependency from
gateway/run.pytoplugins.memory.honcho.client.HonchoClientConfig:https://github.com/NousResearch/hermes-agent/blob/main/gateway/run.py#L14677-L14695
Problem
Layering violation. Gateway code shouldn't know about specific memory-provider plugins by name. If
mem0,supermemory,hindsight, or any future memory provider adds analogous identity-mapping config (which they plausibly will, given the per-user-peer pattern this PR established), each one would require anothertry/except: from plugins.memory.X import ...block in core gateway code.Per-message disk I/O for everyone.
HonchoClientConfig.from_global_config()doespath.read_text()+json.loads()on every gateway message — including for users who don't run Honcho at all. The file is small so it's microseconds, but it's still unnecessary work on the hot path.Proposed fix
Add a
cache_busting_signature() -> dict | Nonehook to theMemoryProviderABC (agent/memory_provider.py). Memory providers return a flat dict ofprovider_name.key -> valueentries that should bust the cached agent when they change. The default implementation returnsNone(no busting).Then in
_extract_cache_busting_config, ask the active memory provider for its signature:This also incidentally fixes the per-message disk read for non-Honcho users — only the active provider's hook runs.
Honcho's implementation moves to
plugins/memory/honcho/__init__.py::HonchoMemoryProvider.cache_busting_signature()returning the same 5 keys it returns today.Acceptance criteria
MemoryProvider.cache_busting_signature()exists with a sensible defaultgateway/run.pyinto the plugingateway/run.pyno longer imports fromplugins.memory.honcho.*TestAgentConfigSignatureUserIdtests intests/gateway/test_agent_cache.pystill passContext
hermes-agent-devis that plugin PRs should not require core code changes; this is the same direction in reverse — core code shouldn't reach into plugins by name