fix(telegram): recover stalled ingress spool claims#97118
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 27, 2026, 11:59 AM ET / 15:59 UTC. Summary PR surface: Source +147, Tests +353. Total +500 across 6 files. Reproducibility: yes. The source path is clear and the Mantis Telegram Desktop before/after proof shows the baseline stuck behind claimed rows and the candidate draining queued messages. Review metrics: 2 noteworthy metrics.
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:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land after maintainer acceptance of the SDK-visible queue selectors and Telegram recovery lease, while keeping webhook durability and broader startup recovery tracked separately. Do we have a high-confidence way to reproduce the issue? Yes. The source path is clear and the Mantis Telegram Desktop before/after proof shows the baseline stuck behind claimed rows and the candidate draining queued messages. Is this the best way to solve the issue? Yes for the targeted Telegram isolated-polling drain fix; queue-native claiming removes the split claim path while heartbeat-gated refresh addresses wedged drain renewal without broadening into webhook or all-channel recovery. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f857e8d66eb3. Label changesLabel justifications:
Evidence reviewedPR surface: Source +147, Tests +353. Total +500 across 6 files. View PR surface stats
Acceptance criteria:
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
|
2068f08 to
bd5d6a0
Compare
|
@openclaw-mantis telegram desktop proof: verify stalled Telegram ingress spool claims stop renewing, recover, and queued messages drain in order. |
|
@openclaw-mantis telegram desktop proof: rerun stalled Telegram ingress spool recovery for this PR, but avoid the previous synthetic-proof trap. Use real Telegram Desktop user messages as the seed source so queued rows carry real message_id/thread metadata from the leased chat. If you seed channel_ingress_events manually, copy those real message_id/thread/chat/from fields into the payload instead of inventing fake message ids. The mock model response is static, so do not require per-row echoed markers like 971181/971182; prove candidate success by DB rows draining plus new bot reply message ids appearing after the seeded rows, and prove baseline by the stale claimed row still blocking the later same-lane row. Capture native Telegram Desktop before/after GIFs only if the visible delta is honest. |
Mantis Telegram Desktop ProofSummary: Mantis captured native Telegram Desktop before/after GIF evidence with Convex-leased Telegram credentials.
Motion-trimmed clips: |
|
Ready to land. Proof checked for head
Explicit maintainer tradeoff accepted here: the fix uses a 30-minute stale-claim lease and exposes the generic |
|
Merged via squash.
|




What Problem This Solves
Telegram isolated polling can leave updates permanently claimed while the ingress spool drain is wedged. The claim refresh loop continued advancing
claimed_ateven when no drain cycle completed, and stale PID-reused claims could block later same-lane updates. That matches the reportedchannel_ingress_eventsstate: pending Telegram updates accumulated while claimed rows stayed live.This PR consolidates the queue-native claim fix from #96912 with the stalled-drain lease fix, so there is one canonical Telegram drain path instead of mixed claim implementations.
Why This Change Was Made
claimNextpath with bounded candidate snapshots and same-lane blocking.The queue-native commits retain Dallin Romney's authorship in this branch history; the final commit removes the obsolete current-process fail-on-timeout path so PID-reused work is replayed instead of dead-lettered.
User Impact
This affects Telegram Bot API isolated polling ingress and its SQLite spool only. Stalled Telegram spool claims can become recoverable, PID-reused claims no longer strand a lane, and healthy drain cycles continue refreshing active claims. No direct behavior change is intended for Discord, Slack, Signal, WhatsApp's journal-only queue usage, or non-spooled Telegram webhook delivery.
Evidence
polling-session,telegram-ingress-spool, and sharedingress-queuesuites.check:changedpassed ontbx_01kw33f6bjngpjv0z5c1vtxzqv(Actions run28270524234).bd5d6a072cffdd2072814f148e499f15fbb6523e; proof job83823345394, run28291142592, artifact7925262302, evidence comment: fix(telegram): recover stalled ingress spool claims #97118 (comment).run_1a86842eb325.Related Work