-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
Group session lane wedges indefinitely: stuck-recovery skips with active_reply_work false positive #85639
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: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: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
Summary
Telegram group session lanes can enter a permanent wedged state where messages queue but never dispatch. The stuck-session recovery logic detects the wedge correctly but skips action with
reason=active_reply_work, creating a tautology: "should I clear this stale lane? the lane state says it's active, so I'll keep it."Symptom
Diagnostic logs (gateway.err.log) repeatedly show:
Repeated every ~2 minutes for 23+ days in our case (2026-05-16 through 2026-05-23). New messages from allowlisted senders queue indefinitely (queueDepth=1) and never trigger an agent run.
Reproduction
Hard to reproduce on demand, but the precondition appears to be:
processingwith anactiveSessionIdthat no longer maps to a live runstuck_session_stateclassifier kicks in correctlyactive_reply_workcheck returns true because it reads the lane's ownactiveSessionId— which is the stale one — and concludes "work is still happening"Net effect
Group chat appears dead to the agent. Outside observers (allowlisted senders tagging the bot with
@bot) get no response. No user-visible error — the bot is just silent.Suggested fix
The
active_reply_workcheck should be a liveness probe of the referenced session/run, not a flag-read of the lane's own state. e.g.:activeSessionIdresolves to a process/run that's actually progressing (heartbeat, recent message activity, non-zero CPU on the agent worker)Alternatively: a hard timeout on
processingstate (e.g., 1 hour). If a lane has been processing the sameactiveSessionIdfor >1h without forward progress, force-clear regardless.Workaround
openclaw sessions cleanup --fix-missing(removes the stale sessions.json record if its transcript is missing)openclaw gateway restart(clears in-memory lane state)Environment