Repository navigation
Description
Bug Description
Agent replies to WhatsApp are silently dropped. The reply is generated by the LLM but never dispatched to the WhatsApp channel. pendingFinalDelivery stays True indefinitely.
Root Cause
In dispatch-Bgs9vXV4.js (compiled), the condition at ~line 842 that decides whether to load the route-reply runtime:
const routeReplyRuntime = Boolean(
!suppressAcpChildUserDelivery &&
!isInternalWebchatTurn &&
normalizedRouteReplyChannel &&
replyRoute.to &&
normalizedRouteReplyChannel !== normalizedCurrentSurface // ← BUG
) ? await loadRouteReplyRuntime() : void 0;When a WhatsApp session processes a reply:
normalizedRouteReplyChannel="whatsapp"(from session delivery context)normalizedCurrentSurface="whatsapp"(from ctx.Provider / ctx.Surface)
Since "whatsapp" !== "whatsapp" is false, routeReplyRuntime is never loaded.
Downstream at line 110:
const shouldRouteToOriginating = Boolean(
!params.suppressDirectUserDelivery &&
!isInternalWebchatTurn &&
params.isRoutableChannel(originatingChannel) && // ← () => false because no runtime
params.originatingTo &&
originatingChannel !== currentSurface
);Without the runtime, isRoutableChannel() returns () => false, so shouldRouteToOriginating = false.
At line 867:
if (!shouldRouteToOriginating || !routeReplyChannel || !routeReplyTo || !routeReplyRuntime) return null;routeReplyToOriginating() returns null, so the reply falls through to dispatcher.sendFinalReply() which sends to the internal webchat channel — not WhatsApp. The message is silently dropped from the user perspective.
Why This Happens
The gateway assumes that if originatingChannel === currentSurface, it is already "on" that channel and does not need to dispatch. But the gateway is always internal — it is never "on" the WhatsApp channel. It must actively load the WhatsApp runtime and dispatch outbound messages through it.
Impact
All OpenClaw users with WhatsApp (and likely Telegram, Signal, etc.) direct sessions will never receive agent replies. The messages appear in the webchat UI but are never delivered to the external channel.
Environment
- OpenClaw: 2026.6.1 (2e08f0f)
- Node: v25.8.1
- Platform: macOS (arm64)
- WhatsApp channel: @openclaw/whatsapp
Workaround
Patched the condition to also load the runtime for non-webchat channels:
|| (normalizedRouteReplyChannel && normalizedRouteReplyChannel !== "webchat")This works but is a patch on compiled/minified code and will be lost on updates.
Suggested Fix
In the source code, the route-reply runtime loading condition should load the runtime whenever there is a routable external channel, regardless of whether it matches the current surface. The gateway should always explicitly dispatch to external channels — it cannot assume it is already "on" them.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Jun 4, 2026
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.
Close as duplicate: the current code and latest release still contain the same-surface route-reply guard, but the remaining origin-delivery policy and fix are already tracked by the open canonical issue at #54531. This WhatsApp report adds useful concrete evidence, but it does not need to stay open as a second tracker.
Root-cause cluster
Relationship:
duplicateCanonical: #54531
Summary: This issue is a concrete WhatsApp same-surface manifestation of the broader open origin-delivery routing problem tracked by the canonical issue.
Members:
canonical: feat: Force reply to originating channel (Telegram/Discord/WhatsApp) #54531 - It is open and tracks generated replies being visible internally but not delivered to originating messaging channels, including the same current-surface routing gate.partial_overlap: [Bug]: WhatsApp channel silently drops long/complex agent responses (v2026.5.18) #84092 - It covers WhatsApp reply drops for long or complex responses, but its suspected presentation/outbound boundary is not identical to the same-surface route-reply guard.partial_overlap: Define durable final fallback delivery semantics across channels #87561 - It tracks the broader durable final fallback delivery contract across channels rather than this exact origin-route condition.partial_overlap: WhatsApp session stalls on long model_call: incomplete turn with payloads=0, reply never delivered #84569 - It covers WhatsApp silent non-delivery during long or incomplete turns, which overlaps message-loss impact but has different session-stall and fallback-delivery surfaces.adjacent_distinct: Deny same-provider cross-context message sends by default #95883 - It changes same-provider cross-context message-tool policy and cites origin routing as adjacent, but it does not implement same-surface auto-reply delivery.Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.
Canonical path: Keep #54531 as the canonical origin-delivery decision and preserve this WhatsApp evidence there rather than tracking a second issue.
So I’m closing this here and keeping the remaining discussion on #54531.
Review details
Best possible solution:
Keep #54531 as the canonical origin-delivery decision and preserve this WhatsApp evidence there rather than tracking a second issue.
Do we have a high-confidence way to reproduce the issue?
Yes for source-level reproduction: current main still blocks route-reply runtime and origin routing when the originating channel equals the current surface. I did not run a live WhatsApp current-main reproduction in this read-only review.
Is this the best way to solve the issue?
No as a standalone tracker: the best fix belongs on the canonical origin-delivery issue because current tests and WhatsApp durable delivery paths make this a product and routing-boundary decision.
Security review:
Security review: No patch is under review; routing privacy and product policy should be handled on the canonical issue.
AGENTS.md: found and applied where relevant.
What I checked:
hasRouteReplyCandidateonly loads route-reply runtime whennormalizedRouteReplyChannel !== normalizedCurrentSurface, matching the reported source condition. (src/auto-reply/reply/dispatch-from-config.ts:1875, de30d2f5c333)resolveReplyRoutingDecisionrequiresoriginatingChannel !== currentSurfacebefore settingshouldRouteToOriginating, so the source-level behavior is not fixed on main. (src/auto-reply/reply/routing-policy.ts:22, de30d2f5c333)hasRouteReplyCandidateand the samenormalizedRouteReplyChannel !== normalizedCurrentSurfacepredicate, so this is not implemented in a release. (src/auto-reply/reply/dispatch-from-config.ts:1594, e085fa1a3ffd)routeReplyand use the dispatcher, which is why a safe fix belongs with the canonical routing decision rather than a blind guard edit. (src/auto-reply/reply/dispatch-from-config.test.ts:1335, de30d2f5c333)deliverInboundReplyWithMessageSendContext, so the final fix needs to reconcile route-reply with the existing channel-owned durable dispatch path. (extensions/whatsapp/src/auto-reply/monitor/inbound-dispatch.ts:714, de30d2f5c333)originatingChannel !== currentSurfacecondition.Likely related people:
src/auto-reply/reply/dispatch-from-config.ts)src/auto-reply/reply/dispatch-from-config.ts)extensions/whatsapp/src/auto-reply/monitor/inbound-dispatch.ts,src/auto-reply/reply/dispatch-from-config.ts)pendingFinalDeliverycleanup indispatch-from-config, overlapping the stuck pending-final symptom. (role: recent pending-final contributor; confidence: medium; commits: eab22a911a2d; files:src/auto-reply/reply/dispatch-from-config.ts)Codex review notes: model internal, reasoning high; reviewed against de30d2f5c333.
soymarketing commentedon Jun 4, 2026
Confirming this on 2026.6.2-beta.1 (Raspberry Pi, WhatsApp via Baileys, codex/gpt-5.5).
Repro / data point: A WhatsApp group agent that replies with plain final text (auto-delivery) is silently dropped — inbound received, agent runs, reply text produced, but zero outbound and nothing queued. DMs from the same agent deliver fine — but only because in DMs the agent also calls
message(action="send"), which takes a different dispatch path. This lines up with the root cause here: the broken path is the auto-delivered route-reply (originatingChannel === currentSurfacefor WhatsApp), while the explicit message-tool send is unaffected.Workaround that fully restores group delivery: instruct the agent to deliver group replies via
message(action="send", to="<jid>", message=...)and end the turn withNO_REPLY, instead of relying on plain-text auto-delivery. One clean send, no duplicate.Regression timeline on our side: last working group auto-reply was on the prior version; it broke immediately after updating to 2026.6.2-beta.1.
openclaw-barnacle commentedon Jul 6, 2026
This issue has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.
openclaw-barnacle commentedon Jul 6, 2026
This issue has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.