Repository navigation
Description
Summary
Sending 3–4 WhatsApp DMs in rapid succession (2–6 s apart, plain short text) reliably breaks the agent session. We observed two distinct failure modes, on both 2026.5.28 and 2026.6.1:
Mode A — embedded_run hangs at started before any model call, and the session stays poisoned.
The first run of the burst hangs at lastProgress=embedded_run:started (no model/HTTP activity; the provider answers a direct curl in ~2 s with the same key). After the watchdog aborts it, every subsequent run on that session also hangs at started, including runs for fresh messages sent minutes later. Only archiving the session files + restarting the gateway recovers the lane. 1-to-1 (non-burst) traffic on a fresh session works flawlessly for hours.
Mode B (seen on 2026.6.1) — runs complete but final replies are never delivered.
For the last 2 messages of a burst the transcript shows the assistant answers were generated (they are in the session .jsonl), but no Sent message ever happens, no watchdog/stall diagnostic fires, the event loop is healthy (/healthz answers in ~1 ms, CPU idle), and the session reports 0 active · 0 queued. The replies are silently lost. This looks like the pendingFinalDelivery family (#83184, #85743, #84238).
We also hit the exact signature of #91700 on a DM lane (not just groups), on both versions:
stuck session recovery: … action=abort_embedded_run aborted=true drained=true released=0
stuck session recovery outcome: status=aborted … forceCleared=false released=0
Environment
- OpenClaw
ghcr.io/openclaw/openclaw:2026.5.28and:2026.6.1(Docker, Linux x86_64) - Channel: WhatsApp (official
@openclaw/whatsapp@2026.6.1install on 2026.6.1) - Model: MiniMax-M2.7 via
openai-completionsprovider (reasoning: false) - Relevant config:
messages.queue.byChannel.whatsapp="followup",messages.inbound.byChannel.whatsapp=0,queue.debounceMsByChannel.whatsapp=0,agents.defaults.maxConcurrent=1,diagnostics.stuckSessionWarnMs=30000,stuckSessionAbortMs=60000 - Also reproduces with the default
collectqueue mode, with inbound debounce 2500, and with all third-party plugins disabled — and identically from the web UI (same session), so it is not channel-specific.
Repro
- Link WhatsApp, fresh session, send single DMs → all answered normally (sub-10 s each).
- Send 3–4 short DMs back-to-back (2–6 s apart), e.g. "Capital de X" variations.
- First (or an early) run hangs at
embedded_run:started;queueDepthgrows.
Mode A evidence (2026.6.1, timestamps UTC, numbers redacted)
17:52:53 Inbound message +52…997 (direct, 88 chars)
17:52:56 Inbound message +52…997 (direct, 102 chars)
17:53:23 Inbound message +52…997 (direct, 90 chars)
17:54:31 stalled session: … state=processing age=41s queueDepth=2
classification=stalled_agent_run activeWorkKind=embedded_run
lastProgress=embedded_run:started lastProgressAge=85s recovery=none
17:55:01 stuck session recovery: … action=abort_embedded_run aborted=true drained=true released=0
17:55:01 stuck session recovery outcome: … forceCleared=false released=0
On 2026.5.28 the same burst pattern additionally poisoned the session permanently: after the abort, the next queued message started a new run that also hung at started, repeating every watchdog cycle (~90 s per message, none ever reaching the model).
Mode B evidence (2026.6.1)
Burst tail: inbound at 17:59:36 and 17:59:39. Session transcript contains the assistant answers for both (generated), but the gateway log shows no Sending/Sent message for either, no stall/recovery diagnostics at all after 18:00:03, and openclaw status --deep reports 0 active · 0 queued · 0 running. Gateway HTTP healthy throughout. Messages were acked (not re-delivered after restart), so the replies are simply gone.
Expected
- A run that makes no progress before the first model call should be cancellable and the lane freed on the first watchdog abort (
released>0), on DM lanes too (cf. Stuck-session recovery aborts the embedded run but never releases the session lane → group agent stays silent ~15 min after the run is dead #91700). - An aborted/poisoned run must not poison subsequent runs of the same session.
- A completed run's final reply should either be delivered or surface a delivery diagnostic — never silently dropped.
Workarounds we currently use
- Archive
agents/main/sessions/*+sessions.json={}+ gateway restart (recovers the lane; loses the queued turns). - Routing inbound through a plugin
before_dispatchhook (returning{handled:true}) to an external worker completely avoids the bug — the lightweight/tools/invokemessage-send path has never wedged for us, which further isolates the problem to the embedded agent run/delivery pipeline.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Jun 10, 2026
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.
Close as duplicate/superseded: the lane-wedge half is fixed on current main, the post-send pending-final race is also fixed on current main, and the remaining silent/no-proof final-delivery behavior is already owned by the canonical open delivery-contract issue.
Canonical path: Keep the canonical final-delivery contract work on #87561 and rely on the current-main stuck-session recovery fixes instead of maintaining this combined duplicate tracker.
So I’m closing this here and keeping the remaining discussion on #87561.
Review details
Best possible solution:
Keep the canonical final-delivery contract work on #87561 and rely on the current-main stuck-session recovery fixes instead of maintaining this combined duplicate tracker.
Do we have a high-confidence way to reproduce the issue?
Yes. The original report has production logs, current source/tests prove the lane-release fix now exists, and the remaining no-proof final-delivery behavior is source-backed by the canonical open delivery-contract issue; no live WhatsApp burst was run in this read-only review.
Is this the best way to solve the issue?
Yes for cleanup. Closing this broad duplicate is the best repository-maintenance path because the fixed pieces already landed on main and the remaining behavior belongs on the canonical delivery-contract tracker.
Security review:
Security review: No PR diff is under review, and the issue is not a security report.
AGENTS.md: found and applied where relevant.
What I checked:
src/logging/diagnostic-stuck-session-recovery.runtime.ts:255, 865e4db1cd0a)src/logging/diagnostic-stuck-session-recovery.runtime.test.ts:448, 865e4db1cd0a)src/auto-reply/reply/dispatch-from-config.ts:3300, 865e4db1cd0a)Likely related people:
src/logging/diagnostic-stuck-session-recovery.runtime.ts,src/logging/diagnostic-stuck-session-recovery.runtime.test.ts,src/logging/diagnostic-stuck-session-recovery.integration.test.ts)src/auto-reply/reply/dispatch-from-config.ts,src/auto-reply/reply/dispatch-from-config.reply-dispatch.test.ts)src/infra/outbound/deliver.ts,src/channels/message/send.ts,src/channels/plugins/outbound.types.ts)src/logging/diagnostic-stuck-session-recovery.runtime.ts,src/auto-reply/reply/dispatch-from-config.ts,src/channels/turn/durable-delivery.ts)Codex review notes: model internal, reasoning high; reviewed against 865e4db1cd0a.