openclaw - 💡(How to fix) Fix WhatsApp group: CLI assistant reply generated but never dispatched (group lane only — DM works) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#78120Fetched 2026-05-06 06:16:45
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
2
Author
Timeline (top)
closed ×1commented ×1

CLI backend (claude-cli) generates a reply for inbound WhatsApp group messages, but the reply never reaches the WhatsApp dispatch path. WhatsApp DM replies on the same setup work correctly. The agent runs to completion and writes its assistant text to the Claude CLI session jsonl, but [whatsapp] Sending message is never logged for the group response.

Root Cause

This bug has been silently present for at least the last 3 days. An older group session trajectory snapshot from 2026-05-03 shows model.completed with 130 output tokens followed by session.ended with assistantTexts: 0 — so OpenClaw was discarding the assistant text from the model output even back then. The bug went unnoticed because the only observable WhatsApp activity in that group was an unrelated daily cron sending pre-built messages directly to the group (not via the agent reply path).

Fix Action

Fix / Workaround

CLI backend (claude-cli) generates a reply for inbound WhatsApp group messages, but the reply never reaches the WhatsApp dispatch path. WhatsApp DM replies on the same setup work correctly. The agent runs to completion and writes its assistant text to the Claude CLI session jsonl, but [whatsapp] Sending message is never logged for the group response.

Despite this, the WhatsApp dispatch path never fires for the group lane.

In extensions/whatsapp/src/auto-reply/monitor/dispatch.ts (compiled into monitor-C4Fhg_lD.js), the dispatchWhatsAppBufferedReply function delivers replies via:

Code Example

ASSISTANT TEXT: "Hey Raj 👋 What's up? 🔵🌀"

---

const reply = resolveSendableOutboundReplyParts(normalizedDeliveryPayload);
if (!reply.hasMedia && !reply.text.trim()) return;
RAW_BUFFERClick to expand / collapse

Summary

CLI backend (claude-cli) generates a reply for inbound WhatsApp group messages, but the reply never reaches the WhatsApp dispatch path. WhatsApp DM replies on the same setup work correctly. The agent runs to completion and writes its assistant text to the Claude CLI session jsonl, but [whatsapp] Sending message is never logged for the group response.

Reproducer

  • OpenClaw 2026.5.3-1
  • Claude CLI 2.1.126 backend (Max plan, OAuth)
  • WhatsApp account paired, channels.whatsapp.groups["<groupId>@g.us"].requireMention = false
  • Group sender is in channels.whatsapp.groupAllowFrom

Send any message into the configured group with requireMention: false. The bot processes the message — [whatsapp] Inbound message <groupId>@g.us is logged, then [agent/cli-backend] cli exec: provider=claude-cli model=opus trigger=user fires. The Claude CLI session jsonl gains both the user prompt and an assistant text response. But [whatsapp] Sending message is never logged for the reply, and OpenClaw's session jsonl + trajectory.jsonl are not written either.

Side-by-side evidence (same gateway, same WhatsApp account, same agent)

LaneCLI generates response[whatsapp] Sending messageReaches user
WhatsApp DM✓ (text in CLI session jsonl)
WhatsApp group✓ (text in CLI session jsonl)

For the group, an example response captured in Claude CLI's session jsonl:

ASSISTANT TEXT: "Hey Raj 👋 What's up? 🔵🌀"

Despite this, the WhatsApp dispatch path never fires for the group lane.

Suspected location

In extensions/whatsapp/src/auto-reply/monitor/dispatch.ts (compiled into monitor-C4Fhg_lD.js), the dispatchWhatsAppBufferedReply function delivers replies via:

const reply = resolveSendableOutboundReplyParts(normalizedDeliveryPayload);
if (!reply.hasMedia && !reply.text.trim()) return;

Either dispatchReplyWithBufferedBlockDispatcher is not extracting any text from the CLI stream for group lanes, or resolveSendableOutboundReplyParts is returning an empty reply.text (after trim) and short-circuiting before deliverReply.

A HEARTBEAT_OK-strip filter is also wired into the dispatcher (onHeartbeatStrip), worth verifying it isn't over-matching for group payloads.

Bug history (not just a recent regression)

This bug has been silently present for at least the last 3 days. An older group session trajectory snapshot from 2026-05-03 shows model.completed with 130 output tokens followed by session.ended with assistantTexts: 0 — so OpenClaw was discarding the assistant text from the model output even back then. The bug went unnoticed because the only observable WhatsApp activity in that group was an unrelated daily cron sending pre-built messages directly to the group (not via the agent reply path).

Setup details

  • OpenClaw 2026.5.3-1
  • channels.whatsapp.groupPolicy: "allowlist"
  • channels.whatsapp.dmPolicy: "pairing"
  • messages.ackReactionScope: "group-mentions"
  • agents.defaults.model.primary: "claude-cli/claude-opus-4-6"
  • agents.defaults.model.fallbacks: ["claude-cli/claude-sonnet-4-6", "google/gemini-2.5-flash"]
  • cliBackends.claude-cli.command: "/home/ubuntu/.local/bin/claude" with -p --output-format stream-json --include-partial-messages --verbose

DMs work end-to-end with the exact same agent/model/CLI configuration. Only the group lane drops the response.

extent analysis

TL;DR

The issue is likely due to the dispatchWhatsAppBufferedReply function not extracting text from the CLI stream for group lanes or returning an empty reply.text, causing the WhatsApp dispatch path to never fire.

Guidance

  • Verify that the dispatchReplyWithBufferedBlockDispatcher function is correctly extracting text from the CLI stream for group lanes.
  • Check the resolveSendableOutboundReplyParts function to ensure it's not returning an empty reply.text (after trim) for group lanes.
  • Investigate the HEARTBEAT_OK-strip filter to confirm it's not over-matching for group payloads.
  • Review the channels.whatsapp.groupPolicy and channels.whatsapp.dmPolicy settings to ensure they are correctly configured for the group lane.

Example

No code snippet is provided as the issue is more related to the logic and configuration of the WhatsApp dispatch path.

Notes

The issue has been present for at least 3 days, and the fact that DMs work end-to-end with the same agent/model/CLI configuration suggests that the problem is specific to the group lane.

Recommendation

Apply a workaround by modifying the dispatchWhatsAppBufferedReply function to log more detailed information about the reply object, allowing for better debugging and identification of the root cause.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING