-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
Telegram direct session remains running after restart with hasActiveRun=false #90525
Copy link
Copy link
Closed
Closed
Copy link
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.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.
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.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
Give feedbackNo fields configured for issues without a type.
Summary
A Telegram direct session can remain persisted as
status: runningafter a gateway restart/interruption, even though the gateway has no active task or active run for that session. Once this happens, Telegram polling may be healthy and inbound messages may be recorded, but replies do not complete until the affected session is manually reset.Environment
2026.6.1 (2e08f0f)Observed behavior
After a Telegram direct message triggered a model call, the session stalled and the gateway was restarted while the run was still in progress. After restart:
openclaw gateway statusreported the gateway reachable and running.openclaw channels status --probereported Telegram enabled/configured/running/connected/works.openclaw gateway call statusshowed no active work:tasks.active = 0tasks.byStatus.running = 0tasks.byStatus.queued = 0openclaw gateway call sessions.liststill showed the Telegram direct session as:key: agent:main:telegram:direct:<redacted-peer-id>status: runninghasActiveRun: falseIn this state, new Telegram messages were not getting normal replies. A manual RPC reset of the affected session fixed the problem immediately:
openclaw gateway call sessions.reset --params '{"key":"agent:main:telegram:direct:<redacted-peer-id>","reason":"reset"}'After the reset:
status: done,hasActiveRun: false.Relevant redacted log excerpts
The earlier stalled run looked like this:
After restart/recovery, the persisted session state was inconsistent:
{ "key": "agent:main:telegram:direct:<redacted-peer-id>", "status": "running", "hasActiveRun": false }Manual reset fixed it:
{ "key": "agent:main:telegram:direct:<redacted-peer-id>", "status": "done", "hasActiveRun": false }Expected behavior
On gateway startup or stuck-session recovery, OpenClaw should detect persisted sessions that are marked
runningbut have no corresponding active run/task, then transition them to a terminal/interrupted state or otherwise release the lane automatically.A session with
status: runningandhasActiveRun: falseshould not block future Telegram messages indefinitely.Actual behavior
The persisted Telegram direct session remained
runningafter restart with no active run. New Telegram messages were affected untilsessions.resetwas manually called for the affected session key.Possible fix direction
Add startup/recovery reconciliation for session store entries, for example:
status === "running"but no tracked active run/task after recovery, mark it as interrupted/aborted/done and release the session lane.runningentry whenhasActiveRun === false.Notes
There was also a temporary Telegram Bot API polling conflict during debugging caused by an external
getUpdatesrequest. That produced the expected Telegram conflict error and polling restart, but it appears separate from the stale session issue. The stale state was specifically visible asstatus: runningwithhasActiveRun: false, and it was fixed bysessions.reset.