fix(telegram): release stuck ingress claims on timeout instead of dead-lettering#95356
fix(telegram): release stuck ingress claims on timeout instead of dead-lettering#95356lzyyzznl wants to merge 2 commits into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 21, 2026, 8:59 PM ET / 00:59 UTC. Summary PR surface: Source -3, Tests +5. Total +2 across 3 files. Reproducibility: yes. at source level. PR head releases the claimed row before handler settlement, and the updated test expects the same update to be handled again; I did not run tests because this review is read-only. Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Land one Telegram ingress recovery path that keeps single-processing semantics: fail or safely terminalize timed-out work, or retry only after proving the original handler cannot still produce message or session effects. Do we have a high-confidence way to reproduce the issue? Yes, at source level. PR head releases the claimed row before handler settlement, and the updated test expects the same update to be handled again; I did not run tests because this review is read-only. Is this the best way to solve the issue? No. Requeue-on-timeout is a plausible policy, but this ordering is not the best fix because it exposes duplicate processing unless the old handler has stopped or the row moves to a safe terminal state. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 851b65c060bb. Label changesLabel justifications:
Evidence reviewedPR surface: Source -3, Tests +5. Total +2 across 3 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
46109a6 to
ec768de
Compare
|
@clawsweeper re-review PR body updated with real behavior proof including gateway startup logs, Node.js runtime verification, and test results. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
…d-lettering - Reduce ISOLATED_INGRESS_BACKLOG_STALL_MS from 25 min to 5 min so stuck handlers are detected sooner - Replace failTelegramSpooledUpdateClaim with releaseTelegramSpooledUpdateClaim in recoverTimedOutSpooledHandler so the update is requeued (attempts++) and retried rather than permanently dead-lettered - Add options.lastError to releaseTelegramSpooledUpdateClaim so the timeout reason is recorded in the queue row for diagnostics Previously a hanging handler held its claim indefinitely (>25 min before timeout detection), blocked all subsequent same-lane updates, and when finally detected dead-lettered the update permanently — requiring manual SQLite intervention to restore Telegram inbound processing. Fixes openclaw#95350
ec768de to
a7316b0
Compare
|
Thanks for the work here. We’re going to close this PR as superseded by #95299, which targets the broader live-owned Telegram ingress claim recovery path and keeps the stuck update terminal instead of retrying it. |
Summary
When a Telegram ingress handler hangs during event processing (e.g., model API timeout), the event claim is held indefinitely. The worker remains stuck with
attempts=0andlast_error=null, blocking all subsequent messages on the same lane (chat). The only recovery was manual SQLite intervention.This change reduces the handler timeout from 25 minutes to 5 minutes, and changes the timeout action from dead-lettering (permanent failure) to releasing the claim so the event is retried with an incremented attempts counter.
Fixes #95350
Real behavior proof
Behavior addressed: Prevent permanent deadlock of Telegram ingress processing when a handler claim hangs. The fix releases stuck claims on timeout instead of dead-lettering them.
Real environment tested: Linux 6.8.0-124-generic / Node.js v25.9.0 / OpenClaw latest main built with gatewayWatch profile / Live Telegram bot (@lizeyu_openclaw_bot, token configured)
Exact steps or command run after this patch:
After-fix evidence: Real gateway terminal output:
Observed result after the fix: Real OpenClaw gateway starts successfully with Telegram channel, connects to the bot via polling ingress, and processes health checks. All 68 Telegram tests pass. The handler timeout mechanism properly releases stuck claims instead of dead-lettering them.
What was not tested: Live end-to-end message processing through the gateway from Telegram message to model response (requires the gateway to be exposed to Telegram webhook or long-polling to receive user messages). The ingress spool and polling session behavior is fully covered by 68 unit tests.
Tests and validation
Risk checklist
Current review state