-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
Telegram: specific forum topic becomes permanent inbound black hole after stuck-session recovery #91564
Copy link
Copy link
Open
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.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:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.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.staleMarked as stale due to inactivityMarked as stale due to inactivity
Description
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.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:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.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.staleMarked as stale due to inactivityMarked as stale due to inactivity
Type
Fields
Priority
None yet
Summary
A specific Telegram forum topic (
thread_id=905in our case) becomes a permanent inbound black hole: Telegram pushes updates to the bot, OpenClaw acks them off the long-poll queue, but noInbound message ...log line ever appears for that thread and the agent never sees the message. Other topics in the same chat continue to work normally. Outbound to the same thread keeps working.This is reproducible across multiple gateway restarts and survives session-store deletion. We have not found a way to recover the affected thread without abandoning it.
Environment
2026.6.1(commit2e08f0f)pollingmode, isolated polling ingressis_forum: true, bot isstatus: membermessage_thread_id=905topic:17,topic:13, direct chat): unaffectedWhat works
openclaw message send --thread-id 905 ...succeeds, message arrives in the Telegram client.getChatMemberreturnsstatus: memberfor the group.getUpdates?offset=-Nreturns[]after the user posts → confirms OpenClaw acked the update off Telegram's queue.What is broken
For thread 905 specifically:
[]).Inbound message telegram:group:...:topic:905 ...log line is written.This persists through:
openclaw gateway restartcyclesclaudeCliSessionId/cliSessionIds/cliSessionBindingsfor topic 905 insessions.jsonstatus: "failed"→ unset on the session rowsessions.jsonand the underlying transcript JSONLSuspicious log evidence
(All chat ids / user ids / bot username redacted as
-100XXXXXXXXXX,5XXXXXXX62,REDACTED_BOT.)1. Stale lane guard (around the time the black hole started)
After this line, no further inbound for
topic:905is ever logged. The guard is supposed to be in-process state (activeSpooledUpdateHandlersByLaneMap inmonitor-polling.runtime-*.js), so it should clear on restart — but the black hole survives every restart.2. Mismatched session key format
The key
telegram:-100XXXXXXXXXX:905is missing thetopic:segment that real session keys use (agent:main:telegram:group:-100XXXXXXXXXX:topic:905). Some caller is constructing the wrong key and silently failing the resolve. Possibly related to the inbound dispatcher dropping the update before logging it.3. Repeated
topic:905session resets prior to todayThe agent transcript directory shows
topic:905has been auto-reset 3 times in 24 hours:c0ffbf21-...-topic-905.jsonl.reset.2026-06-08T13-05-18.913Zd8243339-...-topic-905.jsonl.reset.2026-06-08T23-56-15.247Z4. Stuck-session recovery right before the black hole started
A
stuck session recoveryaborted the embedded run fortopic:905shortly before the black hole began. Hypothesis: the recovery path leaves residual state somewhere persistent (not the in-process Map) that causes future inbound updates for this exact(chatId, thread_id)to be dropped.Repro shape
abort_embedded_run+ the timed-out-spooled-handler path.Inbound message ...log line, agent never receives. Other topics in the same chat continue to work.Workaround
Users have to abandon the affected thread and create a new one in the same forum group. Even fully removing the session entry + transcript + multiple gateway restarts does not restore inbound to the original thread.
Asks for the maintainer
sessions.jsondeletion + restart and keys off(chatId, thread_id)to drop inbound updates for one specific topic? That's the mystery.sessions.resolvecall usingtelegram:<chatId>:905(withouttopic:) — what's the caller? It's a hint that some component constructs session keys without the thread segment.abort_embedded_runrecovery clear all persisted lane state for that thread, including any dedup / claim / message-cache entries that might key off thread_id alone?Happy to provide more raw log slices, sqlite plugin-state dumps, or attempt patches if guided.