Skip to content

Honcho memory plugin ignores gateway user_id when peer_name is configured #14401

@NewTurn2017

Description

@NewTurn2017

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High — major feature broken, no workaroundcomp/agentCore agent loop, run_agent.py, prompt buildercomp/pluginsPlugin system and bundled pluginsduplicateThis issue or pull request already existstool/memoryMemory tool and memory providerstype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions