Skip to content

Feature/whatsapp group tool - #91407

Closed
elip-OE wants to merge 3 commits into
openclaw:mainfrom
elip-OE:feature/whatsapp-group-tool
Closed

elip-OE wants to merge 3 commits into
openclaw:mainfrom
elip-OE:feature/whatsapp-group-tool

Conversation

@elip-OE

@elip-OE elip-OE commented Jun 8, 2026

Copy link
Copy Markdown

Summary

What problem does this PR solve?

Why does this matter now?

What is the intended outcome?

What is intentionally out of scope?

What does success look like?

What should reviewers focus on?

Summary guidance

This PR description is the contributor's durable explanation of the change. Write it for human maintainers first; ClawSweeper and Barnacle use the same text to understand intent, proof, risk, and current review state.

Describe the intent and outcome in 2-5 bullets. Avoid restating the diff; reviewers and bots can read the changed files.

If this PR fixes a plugin beta-release blocker, title it fix(<plugin-id>): beta blocker - <summary> and link the matching Beta blocker: <plugin-name> - <summary> issue labeled beta-blocker. Contributors cannot label PRs, so the title is the PR-side signal for maintainers and automation.

Linked context

Which issue does this close?

Closes #

Which issues, PRs, or discussions are related?

Related #

Was this requested by a maintainer or owner?

Linked context guidance

Link the issue, PR, discussion, maintainer request, or owner request that explains why this PR should exist. Maintainer context helps reviewers and automation distinguish intended work from drive-by churn.

Real behavior proof (required for external PRs)

  • Behavior or issue addressed:
  • Real environment tested:
  • Exact steps or command run after this patch:
  • Evidence after fix (screenshot, recording, terminal capture, console output, redacted runtime log, linked artifact, or copied live output):
  • Observed result after fix:
  • What was not tested:
  • Proof limitations or environment constraints:
  • Before evidence (optional but encouraged):
Real behavior proof guidance

External contributors must show after-fix evidence from a real OpenClaw setup. Unit tests, mocks, lint, typechecks, snapshots, and CI are supplemental only.

Screenshots are encouraged even for CLI, console, text, or log changes. Terminal screenshots, copied live output, redacted runtime logs, recordings, and linked artifacts count.

If your environment cannot produce the ideal proof, explain that under Proof limitations or environment constraints so reviewers and ClawSweeper can direct the next step properly.

Be mindful of private information like IP addresses, API keys, phone numbers, non-public endpoints, or other private details when providing evidence.

Tests and validation

Which commands did you run?

What regression coverage was added or updated?

What failed before this fix, if known?

If no test was added, why not?

Testing guidance

List focused commands, not every incidental check. CI is useful support, but external PRs still need real behavior proof above when behavior changes.

Risk checklist

Did user-visible behavior change? (Yes/No)

Did config, environment, or migration behavior change? (Yes/No)

Did security, auth, secrets, network, or tool execution behavior change? (Yes/No)

What is the highest-risk area?

How is that risk mitigated?

Risk guidance

Use this for author judgment that is not obvious from the diff. ClawSweeper can see touched files, but it cannot know which behavior you think is risky, why the risk is acceptable, or what mitigation reviewers should verify.

Current review state

What is the next action?

What is still waiting on author, maintainer, CI, or external proof?

Which bot or reviewer comments were addressed?

Review state guidance

Keep this as the durable state for review progress. If useful information appears in comments, fold the current next action or blocker back here so maintainers and ClawSweeper do not need to reconstruct state from comment history.

Joe (OpenClaw) added 2 commits June 8, 2026 06:43
- Widen WhatsAppConnectionControllerHandle to expose getSocket(): WASocket | null
- Add getSocket() implementation in WhatsAppConnectionController
- New agent-tools-group.ts: create/update/info/leave group management
- Register createWhatsAppGroupTool() in channel.ts agentTools array
Standalone plugin that registers the whatsapp_group tool via the Gateway
plugin SDK. Accesses the Baileys socket through the global connection
controller registry.

Actions: create, update, info, leave.
@openclaw-barnacle openclaw-barnacle Bot added channel: whatsapp-web Channel integration: whatsapp-web size: L labels Jun 8, 2026
@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label Jun 8, 2026
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Dependency Guard

This PR changes dependency-related files. Maintainers should confirm these changes are intentional.

Changed files:

  • plugins/whatsapp-group/package.json

Maintainer follow-up:

  • Review whether the dependency changes are intentional.
  • Inspect resolved package deltas when lockfile, shrinkwrap, or workspace dependency policy changes are present.
  • Treat package-lock.json and npm-shrinkwrap.json diffs as security-review surfaces.
  • Run pnpm deps:changes:report -- --base-ref origin/main --markdown /tmp/dependency-changes.md --json /tmp/dependency-changes.json locally for detailed release-style evidence.

@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. label Jun 8, 2026
@github-actions

github-actions Bot commented Jun 8, 2026 •

Copy link
Copy Markdown
Contributor

Dependency graph changes are blocked

OpenClaw does not accept dependency graph changes through PRs unless a repository admin or security explicitly authorizes the current head SHA. Dependency updates are generated internally by maintainers so external PRs cannot change the resolved graph.

Detected dependency graph changes:

  • plugins/whatsapp-group/package.json changed name, version.

If this PR intentionally needs a dependency graph change, ask a repository admin or member of @openclaw/openclaw-secops to comment:

/allow-dependencies-change

The action will approve the current head SHA (eb9eeb17071624e048db25e3b835223f841a66bf) when it reruns. A later push requires a fresh approval.

Comment on lines +18 to +33
async function fetchImageBuffer(pictureUrl: string): Promise<Buffer> {
if (pictureUrl.startsWith("file://")) {
const filePath = pictureUrl.slice("file://".length);
return readFile(filePath);
}
if (pictureUrl.startsWith("/") || pictureUrl.startsWith("./") || pictureUrl.startsWith("../")) {
return readFile(pictureUrl);
}
// HTTP/HTTPS URL
const response = await fetch(pictureUrl);
if (!response.ok) {
throw new Error(`Failed to fetch picture: HTTP ${response.status} ${response.statusText}`);
}
const arrayBuffer = await response.arrayBuffer();
return Buffer.from(arrayBuffer);
}
@clawsweeper

clawsweeper Bot commented Jun 8, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for the contribution. I reviewed the branch, and this PR is not a good landing base for OpenClaw.

Close this PR as a net-negative landing candidate: the useful WhatsApp group-management idea is real, but this branch duplicates implementations, crosses private plugin boundaries, bypasses existing guarded media/send paths, lacks proof, and would need to be replaced rather than repaired in place.

So I’m closing this PR rather than keeping an unmergeable branch open. A new narrow PR that carries only the useful part is welcome.

Review details

Best possible solution:

Keep the feature discussion in the canonical WhatsApp group-management issue and invite a new narrow PR that implements one WhatsApp-owned, explicit-opt-in, policy-guarded tool surface with tests, docs, and redacted live proof.

Do we have a high-confidence way to reproduce the issue?

Not applicable as a feature PR. Source inspection is enough to show current main lacks this capability and that the proposed branch introduces merge blockers rather than fixing a reproduced bug.

Is this the best way to solve the issue?

No. This is not the best way to solve the issue because the branch duplicates the implementation, uses private registry/socket internals, and bypasses existing guarded media and send paths; a single opt-in WhatsApp-owned implementation is the safer direction.

Security review:

Security review needs attention: The diff introduces concrete security-boundary concerns around model-controlled local file reads, raw network fetches, raw WhatsApp socket access, and linked-account group administration.

  • [high] Model-controlled pictureUrl can read files or SSRF — extensions/whatsapp/src/agent-tools-group.ts:18
    Both new tool implementations allow local paths and raw fetch URLs for group pictures without the existing media guard, local-root policy, size limits, or SSRF checks.
    Confidence: 0.95
  • [high] Standalone plugin exposes raw WhatsApp socket internals — plugins/whatsapp-group/index.js:8
    The added plugin reaches into a private global registry and raw Baileys socket, turning socket operations into a model-callable tool without a public SDK or permission boundary.
    Confidence: 0.94
  • [medium] Direct send bypasses delivery safeguards — plugins/whatsapp-group/index.js:213
    The standalone send action bypasses the existing outbound path that performs account routing, logging, media normalization, reaction-target registration, and session delivery behavior.
    Confidence: 0.9
  • [medium] External package metadata is blocked by guard — plugins/whatsapp-group/package.json:2
    The PR adds package metadata under a new root plugin package, and the dependency graph guard reports that repository admin or secops approval is required for the current head SHA.
    Confidence: 0.86

AGENTS.md: found and applied where relevant.

What I checked:

  • Repository policy applied: Root policy requires full PR review, plugin-boundary scrutiny, and compatibility/security risk surfacing; extensions policy requires bundled plugins to use public SDK/local extension boundaries and avoid eager global registry side effects. (AGENTS.md:28, 66079161d72a)
  • Default tool exposure: Current main exposes only the WhatsApp login tool, while the PR diff changes the WhatsApp channel to return both login and group tools; channel tool discovery aggregates every registered plugin agent tool, so this would become part of the default WhatsApp tool surface. (extensions/whatsapp/src/channel.ts:97, 66079161d72a)
  • Unsafe media loading in PR diff: The added fetchImageBuffer accepts file://, relative/absolute filesystem paths, and raw fetch() URLs for model-controlled picture input, while current WhatsApp outbound media uses loadWebMedia through guarded local-root and SSRF-aware helpers. (extensions/whatsapp/src/outbound-media.runtime.ts:4, 66079161d72a)
  • Private duplicate plugin path: The PR adds a second implementation under plugins/whatsapp-group that reads globalThis[Symbol.for("openclaw.whatsapp.connectionControllerRegistry")].controllers directly and registers the same tool name outside the bundled extensions/* workspace surface. (pnpm-workspace.yaml:1, 66079161d72a)
  • Current socket contract has moved: Current main's registry exposes getCurrentSock() plus getSelfIdentity() for guarded successor-socket handling; the PR adds a stale raw getSocket() path and GitHub reports the branch as dirty/conflicting. (extensions/whatsapp/src/connection-controller-registry.ts:6, 66079161d72a)
  • Existing outbound path bypassed: Current WhatsApp sends resolve runtime config/account state, load guarded media, log/redact identifiers, send via the active listener, and register approval reaction targets; the standalone PR send action calls sock.sendMessage(groupJid, { text }) directly. (extensions/whatsapp/src/send.ts:121, 66079161d72a)

Likely related people:

  • steipete: Git shortlog and path history show heavy work across WhatsApp channel boundaries, plugin SDK seams, outbound media, and group-policy-related surfaces that a safe implementation would need to fit. (role: recent area contributor; confidence: high; commits: 1246e2b03a11, 89e8c8672c4d, 43ef8a5a8657; files: extensions/whatsapp/src/channel.ts, extensions/whatsapp/src/send.ts, src/media/web-media.ts)
  • vincentkoc: Recent history includes WhatsApp channel lazy-loading, runtime send/action seams, outbound media seam splitting, and current release-adjacent touches to the same plugin surface. (role: recent WhatsApp runtime contributor; confidence: high; commits: 2050ef2740df, 7d691a3ce33f, 489d0f7cd940; files: extensions/whatsapp/src/channel.ts, extensions/whatsapp/src/outbound-media.runtime.ts, extensions/whatsapp/src/send.ts)
  • mcaxtr: History shows WhatsApp group reaction, gateway routing, and multi-account inbound/socket work adjacent to group operations and listener behavior. (role: adjacent WhatsApp behavior contributor; confidence: medium; commits: 9af8288c05af, aaae1aeb8f56, 458a52610a4d; files: extensions/whatsapp/src/channel.ts, extensions/whatsapp/src/inbound/send-api.ts, extensions/whatsapp/src/inbound/types.ts)
  • Galin Iliev: Current blame for the central WhatsApp channel and connection-registry lines points to a broad recent snapshot commit, but deeper history suggests this is less specific ownership than the WhatsApp-focused contributors above. (role: recent current-main line provenance; confidence: low; commits: 50c82b302006; files: extensions/whatsapp/src/channel.ts, extensions/whatsapp/src/connection-controller-registry.ts, extensions/whatsapp/src/send.ts)

Codex review notes: model internal, reasoning high; reviewed against 66079161d72a.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Jun 8, 2026
Bypasses the session system to send messages directly via the Baileys
socket. Critical for migration openers — avoids session context issues
that caused messages to route to webchat instead of WhatsApp.
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. label Jun 8, 2026
@clawsweeper

clawsweeper Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper applied the proposed close for this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: whatsapp-web Channel integration: whatsapp-web dependencies-changed PR changes dependency-related files merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: L status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants