Repository navigation
Description
Bug type
Behavior bug (incorrect output/state without crash)
Summary
On WhatsApp direct (1:1), sending an image to the main agent wedges the message lane for ~3 minutes before any real processing of the prompt starts. The inbound image is injected as a native multimodal image block into the main agent's run, so the run that ingests it is itself an embedded_run. When that run reaches run:completed, its active-reply marker is not cleared: the lane stays state=processing with reason=queued_work_without_active_run, and the stuck-session recovery skips with active_reply_work (action=keep_lane) for ~3 min before finally escalating to abort_embedded_run and releasing the lane. Only after that does the agent route the request to a worker.
This is the same reason-code signature as the canonical follow-up-drain race #91909 (queued_work_without_active_run → keep_lane/active_reply_work → abort_embedded_run), which was closed as fixed by #95039. However:
- The installed build 2026.6.10 (
aa69b12d) already contains fix(queue): restart dormant followup drains #95039 (merge commit023993249f...,behind_by=0), yet this still reproduces. - [Bug]: Inbound dispatch race: queued message after run completion never starts a new run (
queued_work_without_active_run), agent goes silent until stuck-session watchdog fires #91909 is described as a general race triggered by a fast (~1–2 s) text follow-up on Slack threads. This report is a distinct trigger: an inbound image (multimodal block) on a WhatsApp 1:1 lane, and the lane wedged here without a rapid user follow-up — the queue grew while the user was idle, behind a multimodalembedded_runthat never cleared.
Filing as a focused, image/multimodal-specific variant and cross-referencing #91909 / #95039 so maintainers can either fold it into the canonical tracker or treat it as a surviving variant of the same race.
Environment
- OpenClaw 2026.6.10 (
aa69b12d), self-hosted Linux, systemd user gateway, loopback bind - Channel: WhatsApp direct (1:1)
messages.visibleReplies=automatic- Main agent model:
gpt-5.5 - Queue mode: default (
steer) openclaw tasks list:0 queued · 0 running · 0 issuesduring the wedge (the wedge is invisible to the task subsystem)
Steps to reproduce
- In a WhatsApp direct chat, send the main agent an image (no caption / "what is this?" style).
- The agent receives the image as a native multimodal block, replies once (e.g. a clarifying question), and the run reaches
run:completed. - Observe: the lane stays
processing; subsequent inbound (and internal queue work) does not start a new run. - ~3 min later the stuck-session watchdog fires and
abort_embedded_runreleases the lane; only then does real routing/processing begin.
Observed log evidence (BRT timestamps)
13:37:18 inbound image (no caption) -> injected as native multimodal image block into main's run
13:37:26 main replies (text), run:completed ~13:37:27
13:40:36 WARN stuck session: sessionKey=agent:main:whatsapp:direct:+<redacted>
state=processing age=136s queueDepth=5
reason=queued_work_without_active_run classification=stale_session_state
lastProgress=run:completed lastProgressAge=189s terminalProgressStale=true recovery=checking
13:40:36 .. 13:43:35 (repeated)
stuck session recovery outcome: status=skipped action=keep_lane
activeSessionId=<same> activeWorkKind=embedded_run reason=active_reply_work
13:43:51 stuck session recovery outcome: action=abort_embedded_run -> lane released
13:43:52+ queued messages finally processed; main then spawns the worker correctly
Trajectory confirms the inbound image was present in the model context as a type:image multimodal block (no separate vision/OCR tool call) — i.e. the wedging embedded_run is the main agent's own multimodal run, not a Codex app-server / subprocess (distinguishing this from the Codex-embedded-runner reports #85251 / #85532).
Expected
Receiving an image on a 1:1 lane should not strand the lane. Either the multimodal run's active-reply marker must be cleared on run:completed so the followup drain can start, or recovery must treat lastProgress=run:completed + terminalProgressStale=true as authoritative over a stale embedded_run active_reply_work marker and release the lane immediately instead of waiting ~3 min.
Related
- [Bug]: Inbound dispatch race: queued message after run completion never starts a new run (
queued_work_without_active_run), agent goes silent until stuck-session watchdog fires #91909 (canonical follow-up-drain race;queued_work_without_active_run) — closed as fixed by fix(queue): restart dormant followup drains #95039 - fix(queue): restart dormant followup drains #95039 (the fix, present in 2026.6.10) — this report reproduces after it
- Group session lane wedges indefinitely: stuck-recovery skips with active_reply_work false positive #85639 (group-session
active_reply_workfalse-positive wedge; closed) — same skip reason, different channel
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Jun 25, 2026
Codex review: this still needs some work.
Summary
Keep open: independent official-release reports establish completion-boundary stalls, and the verified recovery improvements do not conclusively resolve the original reply-owner leak.
Reproducibility: Historical production failures are concrete, but neither a current-main reproduction nor a narrow current-source defect is established; this read-only review ran no tests.
Next step
Obtain a redacted current-release trace connecting inbound receipt, reply-owner phase, completion settlement, and successor admission before selecting a focused repair.
Review details
Best possible solution:
Ensure every run-ending path settles its exact reply owner and advances pending messages without replaying completed effects.
Do we have a high-confidence way to reproduce the issue?
Historical production failures are concrete, but neither a current-main reproduction nor a narrow current-source defect is established; this read-only review ran no tests.
Is this the best way to solve the issue?
Repair the lifecycle obligation identified by a current trace; clearing all ownership at run.completed would bypass legitimate delivery and persistence settlement.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning medium; reviewed against 50a5f43bb30b.
Label changes
Label changes:
issue-rating: 🦪 silver shellfish: Current issue advisory state selects this label.issue-rating: 🦐 gold shrimp: Current issue advisory state no longer selects this label.Label justifications:
P1: Independent official-release incidents describe prolonged failures of established channel conversations.impact:session-state: Completed execution, retained reply ownership, and successor admission disagree about whether the session can proceed.impact:message-loss: The discussion includes unprocessed inbound messages and a reported loss, while explicitly correcting recovery flags that overstate loss.Evidence reviewed
What I checked:
src/logging/diagnostic-stuck-session-recovery.runtime.ts:106, c98311f90697)src/logging/diagnostic-stuck-session-recovery.runtime.ts, 0951d0dd307d)src/auto-reply/reply/reply-run-registry.operation.ts:219, c98311f90697)src/auto-reply/reply/dispatch-from-config.lifecycle.ts:656, c98311f90697)src/logging/diagnostic-stuck-session-followup-recovery.integration.test.ts:225, c98311f90697)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.Reviewed October 16, 2026, 1:31 AM ET / 05:31 UTC.
aleps001 commentedon Jul 7, 2026
Update: stronger repro — 24-minute continuous detect/abort loop that never actually drains, isolated from the #86538 lock/takeover family
Fresh repro on the same environment (2026.6.10), this time with a burst of 9 WhatsApp images sent one-by-one over ~26 minutes (WhatsApp's multi-photo send), captured via
journalctl(the daily file log had already rotated out, but the systemd-journal retention covers this window in full — no gaps).Session:
agent:main:whatsapp:direct:<redacted>, sessionId213973c6-....What happened, minute by minute (BRT):
12:07:45— first detection:queueDepth=9 reason=queued_work_without_active_run classification=stale_session_state lastProgress=run:completed terminalProgressStale=true— the same phantom-embedded_run signature as the original report.12:07:45to12:32:00(24 minutes, uninterrupted), the session cycles through the same detect -> reclaim -> abort sequence 7 times:stuck session recovery outcome: status=skipped action=keep_lane ... reason=active_reply_workfor ~2 minutes,stuck session recovery reclaiming stale active reply work,stuck session recovery: ... action=abort_embedded_run aborted=true drained=false released=0.released=0on every single one of the 7 abort cycles. The abort never actually drains the queue or clears the underlying condition — a freshembedded_runmarker reappears within ~2 minutes and the whole detect/keep_lane/reclaim/abort sequence repeats. This is a materially different (and worse) picture than "aborts once and the lane recovers" — here the recovery action is closer to a no-op that just resets the clock.12:32:00(7th abort), immediately after the user sent an explicit closing message ("mandei os 9 print screens") that let a real turn complete (dispatch to a worker) — i.e., what broke the loop was a fresh user-driven turn, not any self-healing by the recovery mechanism itself.EmbeddedAttemptSessionTakeoverError/SessionWriteLockTimeoutErroranywhere in this window — this repro is a clean, isolated case of thequeued_work_without_active_run/active_reply_workmechanism from the original report, without the session-write-lock family from [Bug]: Session write-lock timeouts block subagent delivery lanes #86538 (ruled out explicitly by grepping the full window).Why this matters beyond the original report: the original repro described one detect -> abort -> release cycle resolving in ~3 minutes. This repro shows the same mechanism can loop indefinitely (7+ cycles / 24+ minutes observed here, with no indication it would have stopped without user intervention) because
abort_embedded_runis not actually draining/releasing the lane (released=0every time) — it's only resetting the stale-state clock, not fixing the root marker. That raises the severity: this isn't bounded to a short self-heal window in bursty/multi-image scenarios.Happy to share the raw journald excerpt (redacted) if useful for reproduction.
aleps001 commentedon Jul 7, 2026
Correction / severity upgrade to my prior comment: raw webhook timestamps show a 26-minute delay before the agent even saw the user's closing message, not user-paced sending
My earlier comment in this thread mischaracterized the images as sent "one-by-one over ~26 minutes." Cross-checking the raw WhatsApp inbound-webhook log (before any agent processing) against the session transcript shows something more severe: the user sent everything in a ~90-second burst, but the agent didn't act on the final instruction until 26 minutes later.
Raw inbound arrival (webhook receipt,
journalctl, BRT):All 9 images arrived within ~3 seconds (WhatsApp's native multi-select send), and the closing text arrived 30 seconds later. So the full user-side interaction — 9 images + open + close instructions — took under 100 seconds end-to-end.
But the session transcript (
.jsonl, UTC timestamps, -3h for BRT) only reflects the closing instruction being acted on at 12:32:38 BRT — 26 minutes after it was actually sent. In between, the same session was cycling through the detect -> keep_lane -> reclaim -> abort_embedded_run loop described in my previous comment (7 cycles,released=0every time), and each queued image appears to have been drained roughly once per abort cycle (~every 4 minutes) rather than immediately.Net effect: a burst that should complete in under two minutes took 26 minutes end-to-end, and for essentially all of that window the user's own explicit follow-up instruction ("done sending, please proceed") sat unprocessed behind the phantom-embedded_run loop. The per-image acknowledgment replies the user saw during the wait were themselves being drained from the same backlog at the loop's cadence, not generated in real time — so the conversation looked alive while the actual instruction was stuck.
(Note: the WhatsApp inbound log only records char-count, not body text, so I'm inferring the 12:06:35 message is the closing instruction from timing + the user's own account of when it was sent — not from reading the message body itself.)
gertieloop commentedon Jul 8, 2026
Live repro — same
run:completed→queued_work_without_active_runlane strand, but TEXT-ONLY (no image / no multimodal block). This may broaden the issue beyond the multimodal framing.Environment
c645ec4), self-hosted macOS, loopback bind, WhatsApp direct (1:1) to the main agent.messages.visibleReplies=automatic, default queue mode.runtime=subagent) into the same main session. Flagging this because it appears to be one trigger, not the root cause (see below).What happened (no image anywhere in the flow)
openclaw gateway restart(SIGUSR1 in-process restart) to reload a plugin. The restart drained an in-flight main-session embedded run.run:completedafter the restart (itsllm_outputfired to our dashboard), but the WhatsApp lane stayedstate=processing. Subsequent plain-text inbounds enqueued and never started a new run —queueDepthclimbed 5 → 6, zerothinking_start, total outbound silence. All prompts were text; there was never a multimodal block.age≈306s:released=0on the command lane (no active task to release) yet queued work present — i.e. the command lane hasactive=0,queue>0, and is not pumping. The diagnostic activity marker was cleared atrun:completed(recordRunCompletedclearsactiveEmbeddedRun), so the strand is downstream in the lane scheduler, not the activity tracker.abort_embedded_runit briefly recovered and ran one turn (run:completedagain), then re-wedged within ~10 min with the identicalqueued_work_without_active_runsignature (lastProgressAge=599s). So it's a repeating ~5-min cycle, not a one-shot./stopcleared it immediately — a freshthinking_startfollowed ~1 min later, a full ~4 min before any restart executed. So/stop(killing the in-flight/stale run) is the reliable break; the ~300s auto-recovery is out-paced by re-wedging.Why this looks like a scheduler-level strand (candidate)
With the command lane showing
active=0,queue>0, not advancing (released=0), the lost step appears to be a skippedpump()after a task settles under a bumped lane generation. Insrc/process/command-queue.ts, the completion handler only re-pumps whencompleteTask()returnstrue, andcompleteTaskreturnsfalseontaskGeneration !== state.generation. A SIGUSR1resetAllLanes()/ recoveryresetCommandLane()bumpsstate.generationwhile a task is in flight; when that task finally settles, its completion is treated as stale andpump()is skipped, so a genuinely free single-slot lane with queued entries never advances — until an external enqueue that happens to finddraining=false, the next stuck-sweep, or/stop. (Sharing as a hypothesis for maintainers; happy to be wrong on the exact site.)Offer
I have the full sanitized JSON-log timeline (all identifiers redacted) and can attach excerpts or test against a patch. The useful new signal vs the original report: this reproduces with plain text only, and the built-in recovery re-wedges rather than resolving, so the multimodal
embedded_runis likely a trigger of a more general lane-generation/pump race (cross-ref #91909 / #95039).Jackten commentedon Jul 8, 2026
Additional post-#95039 repro on 2026.6.11, new trigger shape: WhatsApp group lane, wedge occurs after a normally-completed run (not before processing), with a diagnostic detail that narrows the leak to the reply-run registry rather than the run-handle registry.
Environment
e13d838), self-hosted macOS (launchd gui agent), Node 22.22.2#95039(0239932) confirmed contained in the build (git merge-base --is-ancestor→ yes; first tagv2026.6.10)requireMention=falsefor the roommessages.groupChat.visibleReplies=automaticat incident time; modelopenai/gpt-5.5, queue mode default (steer)src/auto-reply/reply/reply-run-registry.ts,src/auto-reply/reply/get-reply-run.ts,src/auto-reply/reply/dispatch-from-config.ts,src/agents/embedded-agent-runner/runs.ts,src/agents/embedded-agent-runner/run-state.ts, andsrc/logging/**are byte-identical to thev2026.6.11tag (verified viagit diff v2026.6.11...HEAD -- <paths>→ 0 lines)Sequence (2026-07-08, UTC)
ff1e686aprocesses them, delivers a visible media reply at 21:48:31 (3EB0181586F6E8DF0AC8DD), then logsembedded run done: runId=ff1e686a durationMs=153388 aborted=falseat 21:48:47.stuck session recovery outcome: status=skipped action=keep_lane reason=active_reply_work activeWorkKind=embedded_run.stuck session recovery reclaiming stale active reply work: age=360s queueDepth=1.action=abort_embedded_run aborted=true drained=false forceCleared=true released=0; lane frees, the queued messages finally process.Silent window for the user: 21:48:47 → 21:55:34 before recovery even began (default
stuckSessionAbortMs= 360s here). Downstream, operator restarts during recovery caused Baileys to redeliver the unacked 10-message burst twice, producing duplicate and out-of-order turn processing — secondary damage, but it's what the wedge escalates into in practice.Diagnostic split: handle registry clean, reply-run registry leaked
The
reason=active_reply_workskips were emitted from the second branch ofrunStuckSessionRecovery(src/logging/diagnostic-stuck-session-recovery.runtime.ts:193), which is only reachable whenactiveSessionIdis undefined — i.e.resolveActiveEmbeddedRunHandleSessionId(sessionKey), the session-file lookup, andisEmbeddedAgentRunHandleActive(sessionId)all found nothing. So at wedge time:ACTIVE_EMBEDDED_RUNS(run-handle registry,src/agents/embedded-agent-runner/runs.ts) — clean, consistent with theembedded run donelog at 21:48:47;isEmbeddedAgentRunActive(sessionId)still returned true viaisReplyRunActiveForSessionId(sessionId)— i.e. the reply-run operation insrc/auto-reply/reply/reply-run-registry.ts(replyRunState.activeRunsByKey) was never completed/released for a run that finishedaborted=falseand had already delivered visible output mid-run.That narrows this survivor past the #95039 drain-restart fix: the dormant-drain restart can't help because the lane still looks occupied to admission — the leak is the un-completed reply-run operation itself, not a missed drain wakeup.
Contrast with the OP variant: here the wedge is after a completed multi-message run on a group lane (documents/PDF media in the batch, not a bare 1:1 image), and the run had already sent a visible reply successfully before completing. So the strand does not require the pre-processing multimodal path — it can happen at the tail of an ordinary successful group turn.
Repro conditions observed
queued_work_without_active_run), agent goes silent until stuck-session watchdog fires #91909 race window closely: the last inbound before the wedge (process-messageat 21:48:47) landed in the same second asembedded run done(21:48:47). Everything after that (21:49:19, 21:50:26, 21:50:59) stranded behind the leaked reply-run operation.Happy to provide fuller log slices (DEBUG-level daily log retained) or run instrumented builds if that helps pin where the reply-run operation misses
complete().48 remaining items
steipete commentedon Oct 24, 2026
Thanks for filing this. We're closing older issues that no longer look actionable on current
main.The latest confirmation is on 2026.7.1, and reply-lane recovery has changed substantially since. We couldn't confirm the stall on current main; if it still happens on a current release, please open a fresh issue with a current trace.