Repository navigation
Conversation
…w#69926) Bring WhatsApp to parity with Feishu, IRC, LINE, Telegram, and Nextcloud-talk by accepting a per-group `allowFrom` list on `channels.whatsapp.groups.<jid>` (and the matching account-scoped entry). A non-empty per-group `allowFrom` overrides (does not merge with) the channel/account-level `groupAllowFrom` for that one JID, while groups without an override keep the channel/account-level list. Empty arrays fall back to the channel/account-level allowlist. The resolver respects the same multi-account inheritance guard as the rest of the WhatsApp config: account-scoped `groups[<jid>].allowFrom` takes precedence over a root-scope entry for the same JID, so root groups do not silently leak into accounts with their own groups map. Changes: - `WhatsAppGroupEntrySchema` and `WhatsAppGroupConfig` gain an optional `allowFrom: string[]` (E.164 phone numbers). - New `resolveWhatsAppConversationGroupAllowFrom` resolver in `inbound-policy.ts`, wired into `resolveWhatsAppIngressAccess` so the effective `groupAllowFrom` passed to `resolveStableChannelMessageIngress` reflects the per-group override for group conversations. - `bundled-channel-config-metadata.generated.ts` regenerated to surface the new field in the bundled channel schema. - `docs/channels/whatsapp.md` documents the per-group override and shows a mixed-trust example. Tests: - New `extensions/whatsapp/src/inbound-policy.test.ts` covers the resolver semantics: override applied, empty list falls back, unrelated groups inherit the account-level list, account-scoped groups override root-scope entries, missing groups map returns the account-level allowlist. - `extensions/whatsapp/src/config-schema.test.ts` gains two cases for the new field at root and account scope. Fixes openclaw#69926.
|
Codex review: needs changes before merge. Reviewed July 3, 2026, 11:51 PM ET / 03:51 UTC. Summary PR surface: Source +24, Tests +202, Docs +29, Generated 0. Total +255 across 8 files. Reproducibility: yes. for the review defect from source: the PR's effective per-group allowlist reaches ingress, while current main's WhatsApp context callers still pass Review metrics: 1 noteworthy metric.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Copy recommended automerge instructionNext step before merge
Security Review findings
Review detailsBest possible solution: Use one WhatsApp-owned effective per-conversation group sender allowlist for ingress admission, command authorization, quoted replies, and group-history visibility before merging. Do we have a high-confidence way to reproduce the issue? Yes for the review defect from source: the PR's effective per-group allowlist reaches ingress, while current main's WhatsApp context callers still pass Is this the best way to solve the issue? No, not yet. The schema and resolver direction is plausible, but the same effective per-conversation allowlist needs to feed supplemental context visibility before this is the narrow maintainable fix. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 9d68f877ac3e. Label changesLabel justifications:
Evidence reviewedPR surface: Source +24, Tests +202, Docs +29, Generated 0. Total +255 across 8 files. View PR surface stats
Security concerns:
Acceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
This pull request has been automatically marked as stale due to inactivity. |
|
ClawSweeper PR egg: 🔥 warming; proof passed, review follow-up or readiness checks remain. Hatch with Rules and detailsHatchability:
About:
|
|
This pull request has been automatically marked as stale due to inactivity. |
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: feat(whatsapp): per-group allowFrom for sender authorization This is item 1/1 in the current shard. Shard 14/20. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
|
Closing due to inactivity. |
Fixes #69926.
Brings WhatsApp to parity with Feishu, IRC, LINE, Telegram, and Nextcloud-talk by accepting a per-group
allowFromlist onchannels.whatsapp.groups.<jid>(and the matching account-scoped entry). A non-empty per-groupallowFromoverrides (does not merge with) the channel/account-levelgroupAllowFromfor that one JID, while groups without an override keep the channel/account-level list. Empty arrays fall back to the channel/account-level allowlist.ClawSweeper triage explicitly cleared this as "narrow, source-proven feature gap with clear files, tests, and boundaries."
Change
WhatsAppGroupEntrySchemaandWhatsAppGroupConfiggain an optionalallowFrom: string[](E.164 phone numbers).resolveWhatsAppConversationGroupAllowFromresolver inextensions/whatsapp/src/inbound-policy.ts, wired intoresolveWhatsAppIngressAccessso the effectivegroupAllowFrompassed toresolveStableChannelMessageIngressreflects the per-group override for group conversations.groups[<jid>].allowFromtakes precedence over a root-scope entry for the same JID, so root groups do not silently leak into accounts with their own groups map.bundled-channel-config-metadata.generated.tsregenerated to surface the new field in the bundled channel schema (verified viapnpm config:channels:check).docs/channels/whatsapp.mddocuments the per-group override semantics and shows a mixed-trust example.Verification
pnpm test extensions/whatsapp/src/inbound-policy.test.ts extensions/whatsapp/src/config-schema.test.ts-- 17/17 pass (6 new resolver cases + 2 new schema cases + existing schema tests).pnpm config:channels:checkclean.pnpm exec oxfmt --check --threads=1clean on every touched file.Real behavior proof
Behavior addressed: operators should be able to express different sender allowlists per WhatsApp group (e.g. "Group A: any team member can drive the bot; Group B: only staff; Group C: only me") without dropping back to a single channel-wide allowlist. The runtime resolver should also honor the multi-account inheritance guard so root-scope per-group lists do not leak into accounts with their own groups map.
Real environment tested: local Linux 6.17 (Node 22.22.2). Live Node process driving the real production
resolveWhatsAppInboundPolicyandresolveWhatsAppConversationGroupAllowFromhelpers from this PR (no mocks). The proof feeds the helper realistic OpenClaw configs (single-account, multi-account, override+inherit+empty cases) and prints the effectivegroupAllowFromthe inbound gate would apply.Exact steps or command run after this patch:
Where
/tmp/proof-69926.mtsdirectly imports the production resolver helpers fromextensions/whatsapp/src/inbound-policy.tsand validates per-group override, fallback on empty, account-scoped override, and inheritance behavior across seven scenarios.Evidence after fix: terminal output captured directly from the live Node process exercising the production helpers.
Observed result after fix:
allowFromreturns exactly that list, suppressing the channel-levelgroupAllowFromfor that JID.groupAllowFrom, so existing configs keep working unchanged.allowFrom: []falls back to the channel-level list, so accidental empties do not silently fail closed for the group.groupAllowFromrather than leaking from the personal account or the channel root.groupsmap of its own, falls back to its own account-levelgroupAllowFrom.What was not tested: a live WhatsApp message ingress against a real WhatsApp Web account. The runtime proof above exercises the production resolver and
resolveWhatsAppInboundPolicychain, and the unit suite covers the schema acceptance plus the resolver semantics under every documented case, but neither runs a real inbound WhatsApp event against a paired account.