Skip to content

[Bug]: send_message ignores WhatsApp group target, routes to home channel instead #18646

@ar-nim

Description

@ar-nim

Bug Description

When calling send_message with a WhatsApp group target (full JID with @g.us suffix),
the message is delivered to the user's home channel instead of the specified group.

send_message(
action='send',
target='whatsapp:<group_id>',
message='...'
)
→ Message delivered to home channel

Steps to Reproduce

  1. Call send_message with target='whatsapp:<group_id>@g.us'
  2. Observe message delivered to home DM channel instead of the group

Expected Behavior

Message delivered to the specified WhatsApp group

Actual Behavior

Message delivered to the user's home channel (<home_chat_id>@s.whatsapp.net).

Affected Component

Gateway (Telegram/Discord/Slack/WhatsApp)

Messaging Platform (if gateway-related)

WhatsApp

Debug Report

Too much personal data in the debug log I don't wanna share here

Operating System

OpenSUSE Leap 16

Python Version

3.11.15

Hermes Version

0.12.0

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

The WhatsApp bridge at http://127.0.0.1:3000/send accepts the same chatId format
and works correctly. The issue appears to be in the platform layer of the
send_message tool — it resolves the WhatsApp target but strips or mishandles
the @g.us group suffix before passing it to the bridge, defaulting to home channel.

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

    P2Medium — degraded but workaround existscomp/gatewayGateway runner, session dispatch, deliveryplatform/whatsappWhatsApp Business adaptertype/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