hermes - 💡(How to fix) Fix [Bug]: BlueBubbles outbound chat resolution can misroute DM replies to group chats. Privacy leak! [1 pull requests]

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…

Error Message

Additional Logs / Traceback (optional)

Root Cause

BlueBubbles adapter can send a 1:1 reply into the wrong group chat because _resolve_chat_guid() falls back from exact chat identity to participant-address matching.

Fix Action

Fixed

Code Example

N/A

---
RAW_BUFFERClick to expand / collapse

Bug Description

BlueBubbles adapter can send a 1:1 reply into the wrong group chat because _resolve_chat_guid() falls back from exact chat identity to participant-address matching.

If the same contact exists in both a DM and one or more group chats, the adapter may resolve an outbound DM target to a group GUID instead of the intended DM. That means a reply intended for a private 1:1 conversation can be delivered into a family/group thread.

This also breaks normal routing assumptions and higher-level chat-to-agent routing. Even if Hermes correctly isolates the inbound session and selects the correct agent, the final outbound delivery step can still rewrite the destination to the wrong chat.

Steps to Reproduce

  1. Set up BlueBubbles with a contact that has both:
  • a direct 1:1 chat
  • at least one group chat containing that same contact
  1. Run Hermes gateway with the BlueBubbles adapter enabled.
  2. Send a message from the 1:1 chat so Hermes replies to that DM target.
  3. Observe that BlueBubbles outbound resolution may select a group chat GUID instead of the DM.
  4. Hermes sends the reply into the wrong group thread.

Expected Behavior

Outbound BlueBubbles sends should resolve only by exact chat identity:

  1. raw GUID passthrough
  2. exact chatIdentifier / identifier match

If no exact match exists, Hermes should fail safely or explicitly create a DM. It should not guess based on chat participants.

Actual Behavior

Hermes can resolve an outbound DM target to a group GUID if that same contact appears in the group's participant list. Once that happens, the reply is sent to the wrong group chat.

This means:

- private 1:1 replies can be delivered into a group chat

  • normal routing can fail even when session isolation and agent selection are otherwise correct
  • config-based chat-to-agent routing is not trustworthy until this delivery-layer bug is fixed

Affected Component

Gateway (Telegram/Discord/Slack/WhatsApp)

Messaging Platform (if gateway-related)

No response

Debug Report

N/A

Operating System

Ubuntu 24.04

Python Version

3.11.15

Hermes Version

Hermes Agent v0.13.0 (2026.5.7)

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

The bug is in gateway/platforms/bluebubbles.py, in _resolve_chat_guid().

Problematic logic:

for part in chat.get("participants", []) or []: if (part.get("address") or "").strip() == target and guid: self._guid_cache[target] = guid return guid

Why this is wrong:

  • participant membership is not a unique chat identity
  • the same contact can appear in both a DM and one or more groups
  • the resolver can therefore return a group GUID for a DM target
  • the bad result is then cached under the bare target, making future sends continue to go to the wrong chat

Why normal routing fails too:

  • Hermes may correctly decide "this inbound message belongs to DM session X"
  • Hermes may correctly select agent A for that DM
  • but _resolve_chat_guid() can still map the outbound DM handle to group chat Y
  • so the failure is at the delivery layer, after higher-level routing has already done the right thing

Proposed Fix (optional)

Remove participant-address fallback from _resolve_chat_guid() and only allow:

  1. raw GUID passthrough
  2. exact chatIdentifier / identifier match

If no exact match exists, do not guess from participants. Fail safe or explicitly create a new DM instead.

Are you willing to submit a PR for this?

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

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 [Bug]: BlueBubbles outbound chat resolution can misroute DM replies to group chats. Privacy leak! [1 pull requests]