hermes - 💡(How to fix) Fix Honcho memory plugin ignores gateway user_id when peer_name is configured [2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#14401Fetched 2026-04-24 06:17:31
View on GitHub
Comments
2
Participants
3
Timeline
8
Reactions
0
Timeline (top)
labeled ×6commented ×2

HonchoMemoryProvider.initialize() is supposed to receive gateway user_id for per-user memory scoping, but it only overwrites cfg.peer_name when peer_name is empty.

That means any Honcho setup with a configured peer_name collapses all gateway users onto the same Honcho peer, defeating the per-user scoping called out in the v0.8.0 release notes.

Error Message

E AssertionError: assert 'static-user' == 'discord_user_789'

Root Cause

HonchoMemoryProvider.initialize() is supposed to receive gateway user_id for per-user memory scoping, but it only overwrites cfg.peer_name when peer_name is empty.

That means any Honcho setup with a configured peer_name collapses all gateway users onto the same Honcho peer, defeating the per-user scoping called out in the v0.8.0 release notes.

Code Example

_gw_user_id = kwargs.get("user_id")
if _gw_user_id and not cfg.peer_name:
    cfg.peer_name = _gw_user_id

---

if self._config and self._config.peer_name:
    user_peer_id = self._sanitize_id(self._config.peer_name)

---

source venv/bin/activate
pytest -q tests/agent/test_memory_user_id.py::TestHonchoUserIdScoping::test_gateway_user_id_overrides_peer_name -vv

---

E       AssertionError: assert 'static-user' == 'discord_user_789'
RAW_BUFFERClick to expand / collapse

Summary

HonchoMemoryProvider.initialize() is supposed to receive gateway user_id for per-user memory scoping, but it only overwrites cfg.peer_name when peer_name is empty.

That means any Honcho setup with a configured peer_name collapses all gateway users onto the same Honcho peer, defeating the per-user scoping called out in the v0.8.0 release notes.

Affected files / lines

  • plugins/memory/honcho/__init__.py:220-226
  • plugins/memory/honcho/session.py:275-283
  • run_agent.py:1206-1208
  • RELEASE_v0.8.0.md:94
  • failing regression test: tests/agent/test_memory_user_id.py:213-238

Why this is a bug

run_agent.py threads gateway user_id into memory-provider init kwargs specifically for per-user memory scoping. But Honcho only applies that user_id if cfg.peer_name is falsy:

_gw_user_id = kwargs.get("user_id")
if _gw_user_id and not cfg.peer_name:
    cfg.peer_name = _gw_user_id

Later, HonchoSessionManager derives the user peer directly from self._config.peer_name when present:

if self._config and self._config.peer_name:
    user_peer_id = self._sanitize_id(self._config.peer_name)

So a configured peer_name forces every gateway conversation to reuse the same Honcho peer identity even though a per-user user_id was provided.

Minimal reproduction / evidence

Run:

source venv/bin/activate
pytest -q tests/agent/test_memory_user_id.py::TestHonchoUserIdScoping::test_gateway_user_id_overrides_peer_name -vv

Current failure:

E       AssertionError: assert 'static-user' == 'discord_user_789'

Expected behavior

For gateway sessions, Honcho should use the threaded user_id for user scoping, or otherwise provide a separate gateway-safe identity field that preserves per-user isolation even when a default peer_name is configured.

Actual behavior

A configured peer_name wins over gateway user_id, so all gateway users share one Honcho peer identity.

Suggested investigation direction

  • Decide whether gateway user_id should always override peer_name, or whether Honcho needs separate concepts for CLI persona identity vs gateway user identity.
  • Add coverage for the configured-peer_name case (the current regression test already exposes it).
  • Verify that the chosen rule does not break CLI-only Honcho setups while still preserving per-user isolation on Telegram/Discord/Slack.

extent analysis

TL;DR

To fix the issue, consider modifying the HonchoMemoryProvider.initialize() method to always use the provided user_id for per-user memory scoping, even when a peer_name is configured.

Guidance

  • Review the current implementation of HonchoMemoryProvider.initialize() and consider changing the condition to always override cfg.peer_name with the provided user_id when it's available.
  • Investigate the impact of this change on CLI-only Honcho setups to ensure it doesn't break existing functionality.
  • Update the regression test tests/agent/test_memory_user_id.py to cover the scenario where peer_name is configured and user_id is provided.
  • Consider introducing a separate concept for gateway user identity to preserve per-user isolation while allowing for a default peer_name configuration.

Example

_gw_user_id = kwargs.get("user_id")
if _gw_user_id:
    cfg.peer_name = _gw_user_id

This example shows a possible modification to always override cfg.peer_name with the provided user_id.

Notes

The chosen solution should balance the need for per-user isolation with the potential impact on existing CLI-only Honcho setups. Thorough testing and verification are necessary to ensure the fix doesn't introduce new issues.

Recommendation

Apply workaround: Modify the HonchoMemoryProvider.initialize() method to always use the provided user_id for per-user memory scoping, as shown in the example. This change should preserve per-user isolation while allowing for a default peer_name configuration.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

For gateway sessions, Honcho should use the threaded user_id for user scoping, or otherwise provide a separate gateway-safe identity field that preserves per-user isolation even when a default peer_name is configured.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING