-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
Telegram inbound dispatch aborts when preflight compaction hits missing Codex thread #86211
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:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.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: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
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:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.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: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Bug type
Behavior bug (inbound channel dispatch aborts before assistant run starts)
Summary
Telegram inbound dispatch can fail during reply-resolver preflight compaction when the stored Codex thread id is stale/missing. The inbound message is accepted by the Telegram channel, but dispatch exits with:
No assistant run starts for that inbound message. The expected recovery would be to clear/replace the stale thread binding, start a fresh Codex thread/session path, or otherwise continue dispatch after missing-thread recovery.
This appears distinct from the general Telegram silent/hang issues because the failure is explicit and occurs before the run starts, with
sessionId=unknownandsource=replyResolver.Environment
Steps to reproduce
Exact deterministic reproduction is not yet known, but the observed sequence was:
thread not found.outcome=error; no assistant run started for that inbound.Expected behavior
If preflight compaction hits a missing Codex thread, OpenClaw should recover instead of aborting inbound dispatch. Acceptable recovery behavior could be:
The inbound message should not be dropped solely because the previous Codex thread id disappeared.
Actual behavior
The inbound message failed before an assistant run started. Multiple consecutive Telegram messages hit the same error until the session/runtime state was repaired or rotated.
Sanitized log examples:
Repeated on subsequent inbound messages:
Impact
Telegram group conversations can appear broken even though the channel receives messages. The user-facing failure is a silent/non-useful failed turn: the inbound is consumed, dispatch errors, and the assistant does not answer until the stale state is repaired or rotated.
Related issues checked
I found related open issues, but none seemed to cover this exact missing-thread/preflight-compaction abort path:
runBoundTurnWithMissingThreadRecoveryThe event-loop/prewarm behavior may be supporting context in this incident, but the actionable bug here is missing-thread recovery during reply-resolver preflight compaction.