openclaw - 💡(How to fix) Fix WhatsApp group commands ignored when owner sender is reported as LID JID [1 comments, 2 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
openclaw/openclaw#77755Fetched 2026-05-06 06:21:54
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
2
Timeline (top)
commented ×1mentioned ×1subscribed ×1

WhatsApp group commands like /new and /stop can be ignored in some group chats when Baileys reports the sender as a WhatsApp LID JID (@lid) instead of a normal phone JID (@s.whatsapp.net).

This appears to break owner/command authorization because the LID sender is not resolved through the WhatsApp auth directory before checking the configured owner allowlist.

Error Message

For an affected group message:

Root Cause

This appears to break owner/command authorization because the LID sender is not resolved through the WhatsApp auth directory before checking the configured owner allowlist.

Code Example

getSelfIdentity(params.msg)
getSenderIdentity(params.msg)

---

getSelfIdentity(params.msg, params.authDir)
getSenderIdentity(params.msg, params.authDir)
RAW_BUFFERClick to expand / collapse

Summary

WhatsApp group commands like /new and /stop can be ignored in some group chats when Baileys reports the sender as a WhatsApp LID JID (@lid) instead of a normal phone JID (@s.whatsapp.net).

This appears to break owner/command authorization because the LID sender is not resolved through the WhatsApp auth directory before checking the configured owner allowlist.

Impact

In affected WhatsApp groups:

  • /new does not start/reset a session.
  • /stop does not stop/reset routing as expected.
  • The command reaches the Gateway, but is treated as unauthorized or skipped before the normal command handler replies.
  • The same account can be authorized correctly when represented as a normal phone JID, but not when represented as a LID JID.

Expected behavior

If the message sender is the configured owner, /new and /stop should be accepted in WhatsApp groups regardless of whether Baileys reports the sender as:

  • a normal phone JID, or
  • a LID JID that can be mapped back through the account auth state.

Observed behavior

For an affected group message:

  • Sender identity sometimes arrives as @lid.
  • Command authorization fails for that LID identity.
  • The equivalent phone JID for the same account authorizes successfully.
  • Result: group control commands are ignored or rejected even though the actual sender is the configured owner.

Likely cause

In @openclaw/whatsapp, command authorization and/or group gating paths call identity helpers without passing the account auth directory, so LID-to-phone resolution cannot happen.

For example, in the current stable package and also in @openclaw/[email protected], resolveWhatsAppCommandAuthorized() appears to call:

getSelfIdentity(params.msg)
getSenderIdentity(params.msg)

instead of passing the auth directory where available, e.g.:

getSelfIdentity(params.msg, params.authDir)
getSenderIdentity(params.msg, params.authDir)

There may be related group gating/history paths with the same issue, especially around owner bypass for control commands before mention gating.

Versions checked

Suggested fix

Thread authDir through the WhatsApp command authorization and group gating identity resolution paths, then add a regression test where:

  1. the configured owner is a phone/E.164 identity,
  2. the incoming group sender is a LID JID,
  3. the auth state can map the LID back to the owner,
  4. /new and /stop are accepted as authorized commands.

Also worth testing mention-prefixed forms in groups if command parsing runs after mention stripping.

extent analysis

TL;DR

Pass the account auth directory to identity helpers in command authorization and group gating paths to enable LID-to-phone resolution.

Guidance

  • Verify that getSelfIdentity and getSenderIdentity are called with the authDir parameter in the affected code paths.
  • Check for other identity resolution functions that may require the authDir parameter to correctly resolve LID JIDs.
  • Test the suggested fix with the provided regression test scenario to ensure /new and /stop commands are accepted as authorized when the sender is a LID JID.
  • Consider adding additional tests for mention-prefixed forms in groups to ensure command parsing works correctly after mention stripping.

Example

getSelfIdentity(params.msg, params.authDir)
getSenderIdentity(params.msg, params.authDir)

Notes

The suggested fix assumes that the authDir parameter is available and correctly populated in the affected code paths. Additional debugging may be required to ensure the authDir is correctly passed and used.

Recommendation

Apply the suggested fix by threading the authDir through the WhatsApp command authorization and group gating identity resolution paths, as it directly addresses the identified issue and enables LID-to-phone resolution.

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…

FAQ

Expected behavior

If the message sender is the configured owner, /new and /stop should be accepted in WhatsApp groups regardless of whether Baileys reports the sender as:

  • a normal phone JID, or
  • a LID JID that can be mapped back through the account auth state.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix WhatsApp group commands ignored when owner sender is reported as LID JID [1 comments, 2 participants]