feat(whatsapp,telegram): add groupPolicy config option#216
Merged
thewilloftheshadow merged 10 commits intoopenclaw:mainfrom Jan 6, 2026
Merged
feat(whatsapp,telegram): add groupPolicy config option#216thewilloftheshadow merged 10 commits intoopenclaw:mainfrom
thewilloftheshadow merged 10 commits intoopenclaw:mainfrom
Conversation
Contributor
🦞 Automated Code Review (Codex)Findings:
Test gaps / suggestions:
Question: Should Telegram group allowlist accept Reviewed by Clawd 🦞 via Codex (53k tokens) |
Contributor
Author
|
Thanks! Addressed the findings:
On the Zod I didn’t add the WhatsApp wildcard allowlist test yet; can add if you’d like. |
Contributor
Author
|
Follow-up for the review asks:
|
Contributor
Author
|
Re-ran tests after adding the DM Result: PASS — 160 files passed, 2 skipped (live tests). |
- [MED] Strip telegram: prefix in group allowlist matching - [LOW] Fix docs contradiction about allowFrom usage - [LOW] Add explanatory comment for Zod default+optional pattern - [T1] Add WhatsApp wildcard allowlist test - [T2] Add Telegram prefixed ID test All 888 tests pass.
50f6556 to
93f3390
Compare
dgarson
added a commit
to dgarson/clawdbot
that referenced
this pull request
Feb 7, 2026
* feat: phase 0 to 3 for meridia enhancements/refactoring * feat(meridia): phase 2 refactoring — sanitize, migrations, fanout, adapter tests Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: clean up stray brace and unused imports from merge resolution Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(meridia): use readPositiveNumber for compaction/capture thresholds readNumber accepts 0/negative values, but scheduleIntervalHours, minExperiencesForCompaction, maxPerHour, minIntervalMs etc. must be positive. Previously, the old local helpers enforced > 0; this was lost when readNumber was extracted to event.ts. Switch to readPositiveNumber which falls back to defaults for non-positive values. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
zooqueen
pushed a commit
to hanzoai/bot
that referenced
this pull request
Mar 6, 2026
Co-authored-by: Marcus Neves <conhecendo.contato@gmail.com> Co-authored-by: Shadow <hi@shadowing.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
groupPolicyconfig option to WhatsApp and Telegram for controlling group message handling.The Problem
Users expect
allowFromto restrict all communication, but groups bypass this check entirely (by design - they use mention-gating instead). This leaves no way to block group messages completely.Solution
New
groupPolicyoption with 3 modes:openallowFrom, only mention-gating applies.disabledallowlistallowFrom.Implementation Details
GroupPolicySchemaconstant for DRY validationgroupPolicyfollowsallowFromin both schemasallowFrom@prefix)telegram:123456789format works in group allowlist.map()calls per message)Changes
src/config/zod-schema.tsGroupPolicySchemaconstant with explanatory commentsrc/config/types.tsgroupPolicytoWhatsAppConfigandTelegramConfigsrc/web/inbound.tssrc/telegram/bot.tssrc/web/monitor-inbox.test.tssrc/telegram/bot.test.tsdocs/groups.mddocs/plans/group-policy-hardening.mdSelf-Critique Fixes (Hardening)
telegram:prefix.default().optional()pattern undocumentedallowFrom: ["*"]telegram:123456789formatBackwards Compatibility
Default is
open- existing users see no behavior change.Test Plan
groupPolicy: "disabled"blocks all group messagesgroupPolicy: "allowlist"filters by sender (ID or username)groupPolicy: "open"(default) preserves existing behavior["*"]allows all senders in allowlist modetelegram:123456789prefix works in group allowlist