Hi again,
Clawdis is SO much fun as are the hue & spotify tools. Funny bug: I use self-chat mode for now, and when someone @mentions me in a whatsapp group chat, Clawd responds in my place:
Incredibly Clawd resists various requests and jailbreak attempts by my friends (!), though this does mean that anyone @mentioning me in any group chat I am part of has a direct line to Clawd regardless of config or them knowing about Clawd, so thought I'd raise!
Happens because isBotMentioned() checks if selfE164 is in mentionedJids, but in self-chat mode selfE164 is my own phone number. Fix tested and implemented locally on self-phone mode is to detect self-chat mode (when selfE164 is in allowFrom) and skip JID-based mention detection (see below).
This should preserve two-phone behaviour while fixing this issue for self-chat. Happy to submit a small PR if this looks right!
Thomas
Issue writeup
- Expected: Bot only responds to configured mentionPatterns (e.g., @Clawd), and
- Actual: Bot responds to any @mention of me in whatsapp group chats
- Cause: In two-phone mode, selfE164 is the bot's dedicated number, so this check makes sense. In self-chat mode, selfE164 equals the user's number, so any @mention of the user triggers the bot.
- Proposed fix: Detect self-chat mode (when selfE164 is in allowFrom) and skip JID-based mention detection:
const isSelfChatMode =
msg.selfE164 && allowFrom.some((n) => normalizeE164(n) === msg.selfE164);
if (msg.mentionedJids?.length && !isSelfChatMode) {
// Only check JID mentions in two-phone mode
// ...
}
Hi again,
Clawdis is SO much fun as are the hue & spotify tools. Funny bug: I use self-chat mode for now, and when someone @mentions me in a whatsapp group chat, Clawd responds in my place:
Incredibly Clawd resists various requests and jailbreak attempts by my friends (!), though this does mean that anyone @mentioning me in any group chat I am part of has a direct line to Clawd regardless of config or them knowing about Clawd, so thought I'd raise!
Happens because
isBotMentioned()checks ifselfE164is inmentionedJids, but in self-chat modeselfE164is my own phone number. Fix tested and implemented locally on self-phone mode is to detect self-chat mode (whenselfE164is inallowFrom) and skip JID-based mention detection (see below).This should preserve two-phone behaviour while fixing this issue for self-chat. Happy to submit a small PR if this looks right!
Thomas
Issue writeup
clawdor@clawdliterally in the message (matched bymentionPatternsregex), just not via WhatsApp's @mention autocomplete.