Skip to content

message:received hook does not fire for Discord guild channel messages #31212

@wave-workflow

Description

@wave-workflow

Summary

message:received internal hooks do not fire when messages are received in Discord guild channels. They only fire for DMs and WhatsApp messages. Guild messages are routed directly to guild sessions, bypassing the hook event system.

Steps to Reproduce

  1. Create an internal hook listening for message:received events
  2. Configure a Discord guild channel with requireMention: false
  3. Send a message in that guild channel
  4. Observe: the hook handler is never called, but the guild session processes the message normally

Expected Behavior

message:received should fire for ALL inbound messages regardless of channel type (DM, guild, WhatsApp, Telegram, etc.). The hook should fire before or in parallel with the guild session processing.

Actual Behavior

  • WhatsApp DM messages: hook fires ✅
  • Discord DM messages: not tested
  • Discord guild channel messages: hook does NOT fire ❌

Evidence from Logs

# WhatsApp message → hook fires
[discord-digest-hook] EVENT: type=message action=received channelId=whatsapp
[discord-digest-hook] SKIP: not discord (provider=whatsapp)

# Discord guild message → no hook event at all
# Only guild session processing visible:
diagnostic lane enqueue: lane=session:agent:research:discord:channel:1477142180622630952
agent/embedded run start: provider=anthropic model=claude-opus-4-6

Use Case

We want to use message:received hooks to intercept URLs dropped in specific Discord channels and spawn lightweight (Flash) agents for automated analysis, instead of having the full Opus agent process every message. This is a cost optimization pattern: R1 (mechanical) tasks should use cheap models, not the primary expensive model.

Environment

  • OpenClaw: 2026.2.26
  • Node: v22.22.0
  • OS: Ubuntu (WSL2)
  • Discord plugin: enabled, groupPolicy: allowlist

Workaround

Currently using guild sessions with requireMention: false, but this forces all messages through the primary agent (Opus) instead of allowing hook-based routing to cheaper models.

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleMarked as stale due to inactivity

    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