hermes - 💡(How to fix) Fix [WhatsApp] group_sessions_per_user splits agent's view of group context — bot can't see other participants' messages [1 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#15647Fetched 2026-04-26 05:25:59
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×4

Fix Action

Fix / Workaround

Workaround currently in use

  • gateway/session.py:491build_session_key (where the user_id append happens)
  • gateway/platforms/whatsapp.py:906 — bridge already receives participant list
  • gateway/platforms/whatsapp.py:1063-1075 — sender-prefix patch (user-side workaround that I'm running locally to make per-user sessions at least disambiguate the sender's name; not a fix for the missing-other-participants problem)
RAW_BUFFERClick to expand / collapse

Problem

When group_sessions_per_user: true (the default), the gateway builds a session key that includes the sender's user_id for group messages (see gateway/session.py:491 build_session_key). This isolates each participant's conversation with the agent — good for privacy, but it has a side effect: the agent's session for user A in group G has no access to user B's messages in the same group.

For multi-participant chats this means:

  1. The bot can't answer questions like "who's in this group?" — its session only contains the asker (+ itself).
  2. The bot can't summarize earlier discussion if other participants spoke.
  3. The bot can't reference cross-participant context ("as Bob said earlier…").
  4. Skills that try to enumerate participants get a degenerate view.

Repro (WhatsApp)

  1. Three-person group: bot + user A + user B.
  2. User B sends two banter messages, untagged.
  3. User A sends @bot who's in this group?
  4. Bot replies with only itself + user A. User B's name + messages are absent from the session entirely.

(Same shape applies to other group platforms — Slack mpim, Telegram groups, Discord — anywhere group_sessions_per_user is honored.)

Why it matters

The split makes per-user privacy easy but makes the bot useless for group-context tasks (summarization, attribution, participant awareness). Users who want a "helpful group bot" experience have to flip group_sessions_per_user: false, which then merges all participants' DMs-with-the-bot into one shared session — over-shares in the other direction.

Possible directions

A few we've thought about — would appreciate maintainer guidance on which is the right primitive:

  1. Expose group membership via a context attachment the agent can opt into reading. Bridge already knows the participant list (it's available in data.get(\"participants\") — see whatsapp.py:906); surface it as a structured field on the session source rather than burying it in raw event data, and let skills query it.
  2. Read-shared / write-isolated mode: keep per-user write sessions (privacy preserved) but give the agent a read-only "group view" of recent messages from other participants, scoped to the same chat_id. Mirrors how Discord/Slack human users see the channel: shared read, per-user direct messages.
  3. A new policy value (e.g. group_sessions_per_user: shared_context) that opts into option 2.

Option 1 is the smallest change and unblocks the participant-enumeration case. Option 2/3 is the bigger architectural ask but addresses summarization too.

Workaround currently in use

Setting group_sessions_per_user: false works for small trusted groups where cross-user context is acceptable, but it's not a real fix for groups with mixed trust.

References

  • gateway/session.py:491build_session_key (where the user_id append happens)
  • gateway/platforms/whatsapp.py:906 — bridge already receives participant list
  • gateway/platforms/whatsapp.py:1063-1075 — sender-prefix patch (user-side workaround that I'm running locally to make per-user sessions at least disambiguate the sender's name; not a fix for the missing-other-participants problem)

extent analysis

TL;DR

The most likely fix involves modifying the group_sessions_per_user setting or implementing a new policy to allow the agent to access messages from other participants in the same group.

Guidance

  • Consider implementing Option 1: Expose group membership via a context attachment to provide the agent with a structured field containing the participant list, allowing skills to query it.
  • Evaluate Option 2: Read-shared / write-isolated mode to give the agent a read-only "group view" of recent messages from other participants, while preserving per-user write sessions for privacy.
  • Assess the feasibility of introducing a new policy value (e.g., group_sessions_per_user: shared_context) to opt into the read-shared / write-isolated mode.
  • Review the current workaround of setting group_sessions_per_user: false and its limitations for groups with mixed trust levels.

Example

No code snippet is provided as the issue requires a high-level design change rather than a specific code fix.

Notes

The chosen solution should balance privacy concerns with the need for the agent to access group context. The implementation details will depend on the specific requirements and constraints of the system.

Recommendation

Apply a workaround by setting group_sessions_per_user: false for small trusted groups, while exploring a more robust solution like Option 1 or 2 for larger or mixed-trust groups, as these options address the core issue of providing the agent with access to group context while preserving privacy.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix [WhatsApp] group_sessions_per_user splits agent's view of group context — bot can't see other participants' messages [1 participants]