Repository navigation
Conversation
3dff2f1 to
1c0bd26
Compare
Greptile SummaryAdds Confidence Score: 5/5Safe to merge; no P0 or P1 issues found. All findings are P2 style/UX. The implementation is correct, the config placement follows the existing pattern (mirrors how dmPolicy is handled in ExtensionChannelConfig), and the reuse of the mention-gating stack is sound. No files require special attention. Prompt To Fix All With AIThis is a comment left during a code review.
Path: extensions/whatsapp/src/auto-reply/monitor/on-message.ts
Line: 168-179
Comment:
**DM mention patterns sourced from `groupChat` config key**
`buildMentionConfig(loadConfig(), route.agentId)` resolves patterns via `resolveMentionPatterns`, which reads exclusively from `agents[*].groupChat.mentionPatterns` and `messages.groupChat.mentionPatterns` (see `src/auto-reply/reply/mentions.ts:104-119`). This means users enabling `dmRequireMention: true` must configure their trigger patterns under the `groupChat` key — semantically at odds with a DM-only feature. If neither patterns nor an agent `identity` is configured the regex list is empty, so the only passing path is the phone-number body fallback inside `isBotMentionedFromTargets`, which could silently suppress most DMs and be difficult to diagnose. Worth documenting clearly or adding a dedicated `dm.mentionPatterns` resolution path in a follow-up.
How can I resolve this? If you propose a fix, please make it concise.Reviews (1): Last reviewed commit: "feat(whatsapp): add dmRequireMention for..." | Re-trigger Greptile |
1c0bd26 to
8e3f6ee
Compare
8e3f6ee to
c3e626f
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c3e626f066
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Adds a `dmRequireMention` config option that allows authorized DM senders to chat without triggering a bot reply on every message. When enabled, only DMs matching the agent's configured `mentionPatterns` trigger a response — mirroring the existing `requireMention` behavior for groups. Closes openclaw#61607 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
When dmRequireMention is enabled but no mentionPatterns are configured, allow DMs through instead of silently suppressing all messages. Adds a code comment noting that patterns currently resolve from the groupChat config key, with a dedicated dmMentionPatterns path as a follow-up. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Hoist the loadConfig() call into a variable and reuse it in the DM gating branch instead of calling loadConfig() a second time per message. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
f20a22e to
5db76e1
Compare
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Keep this PR open because current main still lacks authorized-WhatsApp-DM mention gating and the linked request was closed in favor of this branch, but it is not merge-ready: the branch conflicts with current main, lacks real WhatsApp proof, and introduces sensitive DM body logging. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Canonical path: Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review. So I’m closing this here because the remaining work is already tracked in the canonical issue. Review detailsBest possible solution: Close this stale PR. The latest review rated it F, the branch still lacks merge-ready proof, and there has been no human follow-up after the durable review. Do we have a high-confidence way to reproduce the issue? Not applicable as a feature PR. Source inspection shows current main has no Is this the best way to solve the issue? No as submitted. Reusing mention-pattern infrastructure is plausible, but the best fix needs a current-main port, privacy-safe logging, policy/docs alignment, regression coverage, and redacted real WhatsApp proof. Security review: Security review needs attention: Security review needs attention because the patch logs skipped private WhatsApp DM content.
AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 010b61746379. |
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
|
This pull request has been automatically marked as stale due to inactivity. |
|
ClawSweeper applied the proposed close for this PR.
|
Summary
dmRequireMentionconfig option to WhatsApp channel (and baseExtensionChannelConfig) that gates DM replies behind mention-pattern matchingmentionPatterns+resolveMentionGatinginfrastructure — no new pattern config neededCloses #61607
Changes
src/config/types.channels.tsdmRequireMentiontoExtensionChannelConfigsrc/config/types.whatsapp.tsdmRequireMentiontoWhatsAppSharedConfigsrc/config/zod-schema.providers-whatsapp.tsdmRequireMentionextensions/whatsapp/src/accounts.tsdmRequireMentionthroughResolvedWhatsAppAccountextensions/whatsapp/src/auto-reply/monitor/on-message.tsExample config
{ "channels": { "whatsapp": { "dmRequireMention": true } }, "agents": { "list": [ { "id": "main", "groupChat": { "mentionPatterns": ["@openclaw"] } } ] } }Test plan
mention-gating.test.tspasses (core gating logic)accounts.test.tspasses (account config resolution)config-accessors.test.tspassesconfig:docs:check,config:channels:check,check:base-config-schema)dmRequireMention: true, send DM without mention pattern → no reply🤖 Generated with Claude Code