Skip to content

[Bug]: MemoryProvider doesn't see multiple user identities in shared sessions #7781

@hughpyle

Description

@hughpyle

Bug Description

Since #17409, providers receive session_id on sync_turn, prefetch, queue_prefetch, and on_session_switch.

But, multi-user attribution is still broken: user_id is passed only once, at initialize(), from the agent's cached _user_id. In a multi-user thread (Discord, Telegram group, group_sessions_per_user: false) every turn after the first is attributed to the original _user_id, not the actual message author.

Additionally, user_name is not exposed; providers can't render attribution even in a single-user session.

Steps to Reproduce

n/a

Expected Behavior

The MemoryProvider on_turn_start hook, or the sync_turn hook, should receive the current user_id and user_name, even for shared sessions.

Actual Behavior

The user_id is available at the start of a session, but doesn't reflect multiple users in the thread.

Affected Component

Agent Core (conversation loop, context compression, memory)

Messaging Platform (if gateway-related)

No response

Operating System

Python Version

Hermes Version

0.8.0

Relevant Logs / Traceback

Root Cause Analysis (optional)

No response

Proposed Fix (optional)

No response

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/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