Bug Description
HonchoMemoryProvider.initialize() only copies the gateway user_id into cfg.peer_name when cfg.peer_name is empty. If the user has configured a static peer_name, every gateway user on that agent instance is forced into the same Honcho peer identity, so per-user memory scoping breaks.
Affected files / lines
plugins/memory/honcho/__init__.py:220-226
plugins/memory/honcho/session.py:275-283
run_agent.py:1206-1208
Why this is a bug
run_agent.py explicitly threads user_id into provider initialization for per-user memory scoping. But Honcho ignores that runtime identity whenever cfg.peer_name is already set, and HonchoSessionManager.get_or_create_session() always prefers self._config.peer_name as the user peer ID source.
That means two different gateway users can silently share the same Honcho user peer / memory bucket whenever a static peer_name is configured.
Minimal reproduction / evidence
Existing test already fails on main:
cd /Users/genie/.hermes/hermes-agent
source venv/bin/activate
pytest -q tests/agent/test_memory_user_id.py::TestHonchoUserIdScoping::test_gateway_user_id_overrides_peer_name -vv
Observed failure:
- expected
mock_cfg.peer_name == "discord_user_789"
- actual
mock_cfg.peer_name == "static-user"
Relevant code path:
_gw_user_id = kwargs.get("user_id")
if _gw_user_id and not cfg.peer_name:
cfg.peer_name = _gw_user_id
Expected Behavior
A gateway-provided user_id should produce isolated per-user Honcho identity, even when a static peer_name exists in config, or the product should clearly separate "assistant peer name" vs "runtime end-user identity" so they do not collide.
Actual Behavior
Configured peer_name wins globally, so multiple gateway users can collapse into the same Honcho memory identity.
Suggested investigation direction
- Decide whether gateway
user_id should always override the runtime user peer for Honcho sessions.
- If
peer_name is meant to represent the assistant or deployment identity, split it from end-user identity instead of reusing one field for both.
- Extend
tests/agent/test_memory_user_id.py to cover the static-peer_name + multiple-user scenario end to end.
Bug Description
HonchoMemoryProvider.initialize()only copies the gatewayuser_idintocfg.peer_namewhencfg.peer_nameis empty. If the user has configured a staticpeer_name, every gateway user on that agent instance is forced into the same Honcho peer identity, so per-user memory scoping breaks.Affected files / lines
plugins/memory/honcho/__init__.py:220-226plugins/memory/honcho/session.py:275-283run_agent.py:1206-1208Why this is a bug
run_agent.pyexplicitly threadsuser_idinto provider initialization for per-user memory scoping. But Honcho ignores that runtime identity whenevercfg.peer_nameis already set, andHonchoSessionManager.get_or_create_session()always prefersself._config.peer_nameas the user peer ID source.That means two different gateway users can silently share the same Honcho user peer / memory bucket whenever a static
peer_nameis configured.Minimal reproduction / evidence
Existing test already fails on
main:Observed failure:
mock_cfg.peer_name == "discord_user_789"mock_cfg.peer_name == "static-user"Relevant code path:
Expected Behavior
A gateway-provided
user_idshould produce isolated per-user Honcho identity, even when a staticpeer_nameexists in config, or the product should clearly separate "assistant peer name" vs "runtime end-user identity" so they do not collide.Actual Behavior
Configured
peer_namewins globally, so multiple gateway users can collapse into the same Honcho memory identity.Suggested investigation direction
user_idshould always override the runtime user peer for Honcho sessions.peer_nameis meant to represent the assistant or deployment identity, split it from end-user identity instead of reusing one field for both.tests/agent/test_memory_user_id.pyto cover the static-peer_name+ multiple-user scenario end to end.