Skip to content

feat(whatsapp): support newsletter targets in message tool#73393

Merged
clawsweeper[bot] merged 5 commits intomainfrom
clownfish/ghcrawl-156943-autonomous-smoke
May 2, 2026
Merged

feat(whatsapp): support newsletter targets in message tool#73393
clawsweeper[bot] merged 5 commits intomainfrom
clownfish/ghcrawl-156943-autonomous-smoke

Conversation

@vincentkoc
Copy link
Copy Markdown
Member

Summary

  • add explicit WhatsApp Newsletter/Channel @newsletter target normalization for outbound message-tool sends
  • route newsletter targets through WhatsApp outbound/session handling without treating them as ordinary direct messages
  • add focused coverage and docs for newsletter/channel outbound targets

Credit

This carries forward the core idea from @agentz-manfred's source PR #13424 with attribution, while addressing the unresolved Greptile review concern about newsletter targets being routed as direct sessions.

Linked refs

Fixes #13417
Related, not closed by this PR: #62697

Validation

  • pnpm check:changed

ProjectClownfish replacement details:

@vincentkoc vincentkoc added clownfish:human-review clawsweeper Tracked by ClawSweeper automation labels Apr 28, 2026
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: whatsapp-web Channel integration: whatsapp-web size: S maintainer Maintainer-authored PR labels Apr 28, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 28, 2026

Greptile Summary

This PR adds first-class support for WhatsApp Channel/Newsletter (@newsletter) JIDs as explicit outbound message targets. It wires newsletter detection through target normalization, outbound resolution (bypassing allowFrom like groups), session routing (channel kind instead of direct), and composing-presence suppression. Documentation and tests are updated across all affected paths.

Confidence Score: 4/5

Safe to merge; no correctness issues found across the routing, normalization, or presence-skipping paths.

No P0 or P1 issues found. The isWhatsAppNewsletterJid guard is applied redundantly in both send.ts (before calling sendComposingTo) and again inside send-api.ts#sendComposingTo, which is intentional defense-in-depth. All key paths are covered by focused tests. Score is 4 rather than 5 to reflect the multi-file scope of the change.

No files require special attention.

Reviews (1): Last reviewed commit: "fix(clownfish): address review for ghcra..." | Re-trigger Greptile

@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented Apr 28, 2026

Codex review: passed.

Summary
Adds WhatsApp @newsletter target normalization, outbound allowFrom bypass, channel session routing, composing-presence suppression, docs/changelog updates, and focused tests.

Reproducibility: yes. Source inspection on current main shows a 120363401234567890@newsletter target normalizes to null before outbound send, and the current session route has only direct/group semantics.

Next step before merge
No repair job is needed; this automerge-opted PR has no actionable review finding and should proceed through exact-head CI and mergeability gates.

Security
Cleared: The diff touches WhatsApp plugin code/tests plus docs/changelog only and adds no dependency, workflow, package-resolution, script, artifact-download, or secret-handling change.

Review details

Best possible solution:

Land this narrow WhatsApp plugin change after exact-head checks pass, and keep inbound newsletter processing tracked separately by #62697.

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

Yes. Source inspection on current main shows a 120363401234567890@newsletter target normalizes to null before outbound send, and the current session route has only direct/group semantics.

Is this the best way to solve the issue?

Yes. The PR stays inside the WhatsApp plugin, uses the existing SDK channel session contract, bypasses DM allowFrom only for explicit group/newsletter targets, and suppresses composing presence for newsletter JIDs.

What I checked:

  • Current main rejects newsletter targets: On current main, normalizeWhatsAppTarget accepts group and user JIDs, then returns null for any remaining target containing @, so 120363401234567890@newsletter cannot normalize before outbound send. (extensions/whatsapp/src/normalize-target.ts:75, 08ce17c33ddb)
  • Current main routes only direct/group sessions: The existing WhatsApp outbound session route chooses group only for group JIDs and otherwise uses direct, matching the unresolved concern from the earlier source PR. (extensions/whatsapp/src/session-route.ts:19, 08ce17c33ddb)
  • SDK already supports channel routes: The generic SDK outbound session route contract already accepts peer.kind and chatType values of direct, group, or channel, so this can be fixed inside the WhatsApp plugin boundary. (src/plugin-sdk/core.ts:319, 08ce17c33ddb)
  • Dependency contract supports newsletter JIDs: The pinned @whiskeysockets/baileys 7.0.0-rc.9 type/source surface includes newsletter as a JID server and exports isJidNewsletter as an @newsletter suffix check. (extensions/whatsapp/package.json:11, 08ce17c33ddb)
  • PR normalizes and authorizes newsletter targets: The PR head adds a numeric @newsletter recognizer, preserves newsletter JIDs during target normalization, includes them in looksLikeWhatsAppTargetId, and bypasses DM allowFrom only for group/newsletter explicit targets. (extensions/whatsapp/src/resolve-outbound-target.ts:36, 9ff3f88202f9)
  • PR fixes session metadata: The PR head maps newsletter JIDs to chatType: "channel" and peer.kind: "channel", and the new session-route test asserts the expected agent:<agentId>:whatsapp:channel:<jid> session key. (extensions/whatsapp/src/session-route.ts:17, 9ff3f88202f9)

Likely related people:

  • vincentkoc: Remote commit history shows prior merged WhatsApp plugin runtime boundary, SDK import, and session-route maintenance overlapping the normalization and outbound route surface changed here. (role: feature-history maintainer; confidence: high; commits: 7d691a3ce33f, 77dfa73736fa, 213198123042; files: extensions/whatsapp/src/session-route.ts, extensions/whatsapp/src/channel.ts, extensions/whatsapp/src/normalize-target.ts)
  • steipete: Recent main-branch commits touch the WhatsApp target normalization, send, and send API areas involved in this PR, including provider-prefixed target guards and outbound send behavior. (role: recent maintainer; confidence: high; commits: 43121fb0968a, 9ffe7644169b, eab402493429; files: extensions/whatsapp/src/normalize-target.ts, extensions/whatsapp/src/send.ts, extensions/whatsapp/src/inbound/send-api.ts)
  • mcaxtr: Recent WhatsApp lifecycle, send API, quoted reply, and media delivery work overlaps the active-listener and outbound send paths touched by the PR. (role: recent adjacent maintainer; confidence: medium; commits: aa023e428306, f5f0235bb18a, 18c98316f7ac; files: extensions/whatsapp/src/send.ts, extensions/whatsapp/src/inbound/send-api.ts, extensions/whatsapp/src/outbound-base.ts)

Remaining risk / open question:

  • Exact-head CI was not fully complete at review time; merge should wait for the remaining in-progress check to finish.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 08ce17c33ddb.

@vincentkoc
Copy link
Copy Markdown
Member Author

/clawsweeper automerge

@clawsweeper clawsweeper Bot added the clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge label May 1, 2026
@clawsweeper
Copy link
Copy Markdown
Contributor

clawsweeper Bot commented May 1, 2026

🦞🦞
ClawSweeper merged this PR after the passing review.

Source: clawsweeper[bot]
Feedback: structured ClawSweeper verdict: pass (sha=9ff3f88202f990c39124bd4b93d8ffcb1674c6e7)
Merge status: merged by ClawSweeper automerge
Merged at: 2026-05-02T20:09:32Z
Merge commit: 0fad53a19281

What merged:

  • Adds WhatsApp @newsletter target normalization, outbound allowFrom bypass, channel session routing, composing-presence suppression, docs/changelog updates, and focused tests.
  • Reproducibility: yes. Source inspection on current main shows a 120363401234567890@newsletter target normalizes to null before outbound send, and the current session route has only direct/group semantics.

Fixups included:

  • Included follow-up commit: fix(clownfish): address review for ghcrawl-156943-autonomous-smoke (1)
  • Included follow-up commit: feat(whatsapp): support newsletter targets in message tool

The automerge loop is complete.

Automerge progress:

  • 2026-05-02 19:37:25 UTC review passed [`dcadd35378d7`](https://github.com/openclaw/openclaw/commit/dcadd35378d7b1d57458540b6e2af4b816b9d25f) (structured ClawSweeper verdict: pass (sha=dcadd35378d7b1d57458540b6e2af4b816b9d...)
  • 2026-05-01 12:12:45 UTC repair queued `dcadd35378d7` (autonomous) Run: https://github.com/openclaw/clawsweeper/actions/runs/25213848870
  • 2026-05-01 12:37:50 UTC repair queued `dcadd35378d7` (autonomous) Run: https://github.com/openclaw/clawsweeper/actions/runs/25214522584
  • 2026-05-01 12:45:18 UTC repair queued `dcadd35378d7` (autonomous) Run: https://github.com/openclaw/clawsweeper/actions/runs/25214733917
  • 2026-05-02 19:33:33 UTC review queued [`dcadd35378d7`](https://github.com/openclaw/openclaw/commit/dcadd35378d7b1d57458540b6e2af4b816b9d25f) (queued)
  • 2026-05-02 19:37:41 UTC repair queued [`dcadd35378d7`](https://github.com/openclaw/openclaw/commit/dcadd35378d7b1d57458540b6e2af4b816b9d25f) (autonomous) Run: https://github.com/openclaw/clawsweeper/actions/runs/25260145957
  • 2026-05-02 19:48:21 UTC repair completed [`e3f8c864a864`](https://github.com/openclaw/openclaw/commit/e3f8c864a8643eee64e171754c93951cbba78529) (branch updated) in 8m 4s Run: https://github.com/openclaw/clawsweeper/actions/runs/25260145957 initial automerge rebase is delegated to Codex repair
  • 2026-05-02 19:48:20 UTC review queued [`e3f8c864a864`](https://github.com/openclaw/openclaw/commit/e3f8c864a8643eee64e171754c93951cbba78529) (after repair)
  • 2026-05-01 12:07:08 UTC review queued [`e3f8c864a864`](https://github.com/openclaw/openclaw/commit/e3f8c864a8643eee64e171754c93951cbba78529) (queued)
  • 2026-05-02 19:50:42 UTC repair queued [`e3f8c864a864`](https://github.com/openclaw/openclaw/commit/e3f8c864a8643eee64e171754c93951cbba78529) (autonomous) Run: https://github.com/openclaw/clawsweeper/actions/runs/25260394781
  • 2026-05-02 19:52:17 UTC review passed [`e3f8c864a864`](https://github.com/openclaw/openclaw/commit/e3f8c864a8643eee64e171754c93951cbba78529) (structured ClawSweeper verdict: pass (sha=e3f8c864a8643eee64e171754c93951cbba78...)
  • 2026-05-02 19:56:53 UTC review queued [`e3f8c864a864`](https://github.com/openclaw/openclaw/commit/e3f8c864a8643eee64e171754c93951cbba78529) (queued)
  • 2026-05-02 20:05:05 UTC repair completed [`9ff3f88202f9`](https://github.com/openclaw/openclaw/commit/9ff3f88202f990c39124bd4b93d8ffcb1674c6e7) (branch updated) in 11m 52s Run: https://github.com/openclaw/clawsweeper/actions/runs/25260394781 initial automerge rebase is delegated to Codex repair
  • 2026-05-02 20:05:05 UTC review queued [`9ff3f88202f9`](https://github.com/openclaw/openclaw/commit/9ff3f88202f990c39124bd4b93d8ffcb1674c6e7) (after repair)
  • 2026-05-02 20:09:18 UTC review passed [`9ff3f88202f9`](https://github.com/openclaw/openclaw/commit/9ff3f88202f990c39124bd4b93d8ffcb1674c6e7) (structured ClawSweeper verdict: pass (sha=9ff3f88202f990c39124bd4b93d8ffcb1674c...)
  • 2026-05-02 20:09:34 UTC merged [`9ff3f88202f9`](https://github.com/openclaw/openclaw/commit/9ff3f88202f990c39124bd4b93d8ffcb1674c6e7) (merged by ClawSweeper automerge)

@clawsweeper clawsweeper Bot force-pushed the clownfish/ghcrawl-156943-autonomous-smoke branch from dcadd35 to e3f8c86 Compare May 2, 2026 19:48
@clawsweeper clawsweeper Bot force-pushed the clownfish/ghcrawl-156943-autonomous-smoke branch from e3f8c86 to 9ff3f88 Compare May 2, 2026 20:05
@clawsweeper clawsweeper Bot merged commit 0fad53a into main May 2, 2026
95 of 96 checks passed
@clawsweeper clawsweeper Bot deleted the clownfish/ghcrawl-156943-autonomous-smoke branch May 2, 2026 20:09
lxe pushed a commit to lxe/openclaw that referenced this pull request May 6, 2026
…73393)

Summary:
- Adds WhatsApp `@newsletter` target normalization, outbound allowFrom bypass, channel session routing, composing-presence suppression, docs/changelog updates, and focused tests.
- Reproducibility: yes. Source inspection on current main shows a `120363401234567890@newsletter` target normalizes to null before outbound send, and the current session route has only direct/group semantics.

ClawSweeper fixups:
- Included follow-up commit: fix(clownfish): address review for ghcrawl-156943-autonomous-smoke (1)
- Included follow-up commit: feat(whatsapp): support newsletter targets in message tool

Validation:
- ClawSweeper review passed for head 9ff3f88.
- Required merge gates passed before the squash merge.

Prepared head SHA: 9ff3f88
Review: openclaw#73393 (comment)

Co-authored-by: vincentkoc <25068+vincentkoc@users.noreply.github.com>
Co-authored-by: openclaw-clownfish[bot] <280122609+openclaw-clownfish[bot]@users.noreply.github.com>
Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
…73393)

Summary:
- Adds WhatsApp `@newsletter` target normalization, outbound allowFrom bypass, channel session routing, composing-presence suppression, docs/changelog updates, and focused tests.
- Reproducibility: yes. Source inspection on current main shows a `120363401234567890@newsletter` target normalizes to null before outbound send, and the current session route has only direct/group semantics.

ClawSweeper fixups:
- Included follow-up commit: fix(clownfish): address review for ghcrawl-156943-autonomous-smoke (1)
- Included follow-up commit: feat(whatsapp): support newsletter targets in message tool

Validation:
- ClawSweeper review passed for head 9ff3f88.
- Required merge gates passed before the squash merge.

Prepared head SHA: 9ff3f88
Review: openclaw#73393 (comment)

Co-authored-by: vincentkoc <25068+vincentkoc@users.noreply.github.com>
Co-authored-by: openclaw-clownfish[bot] <280122609+openclaw-clownfish[bot]@users.noreply.github.com>
Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
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 clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge clawsweeper Tracked by ClawSweeper automation docs Improvements or additions to documentation maintainer Maintainer-authored PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(whatsapp): Support WhatsApp Channel (Newsletter) messages WhatsApp Newsletter/Channel support in message tool

1 participant