-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
[Bug]: WhatsApp dispatch ack timeout returns DISPATCHED-UNKNOWN while send actually succeeds (10s gateway WS deadline + start-account stall) #80177
Copy link
Copy link
Closed
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.
Description
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.
Type
Fields
Priority
None yet
Bug type
Regression (worked before, now fails) — observed on 2026.5.x
Beta release blocker
No (operational impact: false-negative dispatch status causes humans/agents to retry already-delivered messages or treat them as failed)
Summary
wa-send.py(send-gate CLI wrapper for WhatsApp dispatch) returnsDISPATCHED-UNKNOWNwithGatewayTransportError: gateway timeout after 10000mswhile the underlying WhatsApp send actually succeeds and the message is delivered to the recipient.The 10s ack timeout on the dispatch RPC (
ws://127.0.0.1:18789) is too short when the WhatsApp channel is mid-reconnect or stuck inchannels.whatsapp.start-account. The gateway eventually flushes the send to Baileys; recipients receive the message; but the CLI has already returnedunknown. The send-gate lock file is left atoutcome=unknown, downstream agents/scripts believe the send failed, and operators are tempted to retry — risking duplicate sends.Steps to reproduce
ws://127.0.0.1:18789.[whatsapp] Web connection closed (status 428). Retry 1/12 in 2.x s… (status=428 Precondition Required Connection Terminated)every ~5 min and at least one liveness warning of the formphase=channels.whatsapp.start-account recentPhases=channels.whatsapp.start-account:NNNmswith NNN > 10000 (in our incident: ~12,669,716ms — channel hung in start-account for ~3.5h).wa-send.py --target "+<E.164>" --message "…") during this window.DISPATCHED-UNKNOWN: target=… key=… reason=unknown cli=GatewayTransportError: gateway timeout after 10000msand exit code 1.Evidence (real incident, 2026-05-10)
Send-gate lock (recipient details redacted):
{"attempts": 1, "channel": "whatsapp", "dispatcher_exit": 1, "first_attempt_ts": 1778400461.37, "key": "<REDACTED>", "outcome": "unknown", "target_canonical": "+<RECIPIENT>"}Gateway err log around incident:
2026-05-10T11:07:19 [diagnostic] liveness warning: reasons=event_loop_delay … phase=channels.whatsapp.start-account recentPhases=channels.whatsapp.start-account:12669716ms … work=[active=agent:…(processing/model_call,q=1,age=6s)]2026-05-10T11:08:06 [whatsapp] Web connection closed (status 428). Retry 1/12 in 2.22s…CLI return:
DISPATCHED-UNKNOWN … cli=GatewayTransportError: gateway timeout after 10000ms.Recipient confirmation (out-of-band): the WhatsApp message arrived exactly once, ~7 min after the CLI returned
unknown.Follow-up test send to a different recipient 6 min later:
reason=dispatchedreturned in <1s — transport itself is healthy, only ack delivery during the start-account stall is broken.Expected
Either:
unknownwhen the underlying send is actually queued and will be flushed when the WA channel reconnects — the send-gate lock should be reconciled todispatchedonce a Baileys Message ID is observed; orstart-account(back-pressure aware), so the CLI does not return false-negativeunknownoutcomes for sends that actually succeed.Actual
CLI returns
unknownafter exactly 10000ms while the send succeeds asynchronously. Send-gate lock is permanentlyoutcome=unknownwith no reconciliation path. Operators / agents must verify delivery out-of-band (asking the recipient) to know whether retrying is safe.Related issues
ws://127.0.0.1:18789RPC client wrapping every gateway call with a hard-coded 10000ms deadline.start-accountphase after restart (upstream condition that exposes the ack-timeout false-negative).channels.whatsapp.start-accountblocks event loop, triggering reconnect storm.Suggested fix directions
dispatched-unknownoutcome, reconcile send-gate locks once a BaileysMessage IDis observed for the same(target, content_hash)within N minutes — flipoutcomefromunknown→dispatchedand emit a follow-up CLI/heartbeat event so callers can stop treating the send as failed.wa-send.pycan returnQUEUED(exit 2) instead ofDISPATCHED-UNKNOWN(exit 1) when the underlying queue accepted the send but the channel is mid-reconnect.Environment
ws://127.0.0.1:18789(loopback)