Skip to content

WhatsApp DM burst (3–4 messages within seconds) hangs embedded_run at started and poisons the session; on 2026.6.1 completed replies are also silently never delivered #91998

Closed as not planned

Description

@MikeFlores19

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.28 and :2026.6.1 (Docker, Linux x86_64)
  • Channel: WhatsApp (official @openclaw/whatsapp@2026.6.1 install on 2026.6.1)
  • Model: MiniMax-M2.7 via openai-completions provider (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 collect queue 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

  1. Link WhatsApp, fresh session, send single DMs → all answered normally (sub-10 s each).
  2. Send 3–4 short DMs back-to-back (2–6 s apart), e.g. "Capital de X" variations.
  3. First (or an early) run hangs at embedded_run:started; queueDepth grows.

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

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_dispatch hook (returning {handled:true}) to an external worker completely avoids the bug — the lightweight /tools/invoke message-send path has never wedged for us, which further isolates the problem to the embedded agent run/delivery pipeline.

Activity

  1. clawsweeper commented on Jun 10, 2026

    @clawsweeper
    Contributor

    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:

    • Live issue context has no protected close blocker: Live GitHub shows this issue is open, externally authored, unassigned, and has no labels; the body contains two separable failure modes: stuck-session recovery released=0 and silent final-delivery/no-send behavior.
    • Current main releases wedged lanes when session queue depth remains: Current main includes the guarded session-queue release path: recovery captures active task ids, treats params.queueDepth as queued session work, and resets the lane when a clean abort/drain left queued session work behind. (src/logging/diagnostic-stuck-session-recovery.runtime.ts:255, 865e4db1cd0a)
    • Regression coverage pins the formerly reported released=0 shape: The runtime tests now cover clean abort/drain with queued session work and expect the session lane to release instead of preserving the old released=0 behavior. (src/logging/diagnostic-stuck-session-recovery.runtime.test.ts:448, 865e4db1cd0a)
    • Merged stuck-session fix provenance: PR 91802 merged commit f194be1 for the stuck-session lane release bug, and its body explicitly includes both group and direct WhatsApp clean-abort released=0 signatures. (f194be19e261)
    • Post-send pending-final race is fixed on current main: Current main clears pending-final bookkeeping before honoring a late dispatch abort after successful final delivery, matching the focused fix for the interactive pending-final stuck-state race. (src/auto-reply/reply/dispatch-from-config.ts:3300, 865e4db1cd0a)
    • Merged pending-final race fix provenance: PR 93201 merged commit eab22a9 for clearing pending-final state before a post-send abort; the linked issue was closed by that PR. (eab22a911a2d)

    Likely related people:

    • openperf: Authored the merged PR that fixed the clean-abort released=0 lane recovery behavior reported by this issue, including direct-chat scope in the PR body. (role: recent area contributor and stuck-session fix author; confidence: high; commits: f194be19e261; files: 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)
    • amknight: Authored the merged PR that clears pending-final state before honoring a post-send abort in the interactive dispatch path. (role: recent pending-final race fix author; confidence: high; commits: eab22a911a2d; files: src/auto-reply/reply/dispatch-from-config.ts, src/auto-reply/reply/dispatch-from-config.reply-dispatch.test.ts)
    • osolmaz: Authored the open canonical issue that owns the remaining cross-channel sent/failed/suppressed final-delivery semantics and diagnostics contract. (role: canonical delivery-contract issue author; confidence: medium; files: src/infra/outbound/deliver.ts, src/channels/message/send.ts, src/channels/plugins/outbound.types.ts)
    • vincentkoc: Current blame on the recovery and final-delivery files points to a recent release-support commit, and the issue fix discussion records Vincent's maintainer-side confirmation of PR 91802. (role: recent current-main source and release-adjacent contributor; confidence: medium; commits: 94833b2c9072; files: 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.

  2. added
    P1High-priority user-facing bug, regression, or broken workflow.
    impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.
    impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.
    on Jun 15, 2026
  3. locked as resolved and limited conversation to collaborators on Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions