Skip to content

[codex] fix Telegram live-owned stuck ingress claims#95282

Closed
Premsenareddy wants to merge 1 commit into
openclaw:mainfrom
Premsenareddy:codex/fix-release-lane-stuck-ingress
Closed

[codex] fix Telegram live-owned stuck ingress claims#95282
Premsenareddy wants to merge 1 commit into
openclaw:mainfrom
Premsenareddy:codex/fix-release-lane-stuck-ingress

Conversation

@Premsenareddy

Copy link
Copy Markdown

Summary

  • Fail timed-out Telegram spooled ingress claims that are still owned by a live process but no longer have active handler state in this gateway.
  • Keep deferred claims and active in-memory lanes guarded so truly active work is not released.
  • Add regression coverage proving a wedged live-owned same-lane claim is failed and the later update drains without replaying the stuck update.

Root cause

The Telegram isolated ingress drain recovered dead or unowned durable claims, but it skipped any claim held by a live process. If that live worker stopped making progress without leaving active handler state behind, the durable channel_ingress_events row stayed claimed and later same-lane updates remained blocked until gateway restart or manual SQL cleanup.

Validation

  • node scripts/run-vitest.mjs extensions/telegram/src/polling-session.test.ts
  • node scripts/run-vitest.mjs src/channels/message/ingress-queue.test.ts extensions/telegram/src/polling-session.test.ts src/logging/diagnostic-stuck-session-recovery.runtime.test.ts src/logging/diagnostic.test.ts
  • ./node_modules/.bin/oxfmt --check --threads=1 extensions/telegram/src/polling-session.ts extensions/telegram/src/polling-session.test.ts
  • git diff --check

Fixes #95248

@openclaw-barnacle openclaw-barnacle Bot added channel: telegram Channel integration: telegram size: S triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jun 20, 2026
@clawsweeper

clawsweeper Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

Keep this PR open, but it is not merge-ready: the patch addresses the right Telegram stuck-ingress symptom and has strong Mantis proof, yet it can fail a claim owned by another live process using only age plus this gateway's lack of active handler state.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #95248
Summary: This PR is a direct candidate fix for the live-owned Telegram ingress claim issue; related stale-claim work overlaps but does not replace this exact timeout-policy decision.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Canonical path: Close this PR as superseded by #95299.

So I’m closing this here and keeping the remaining discussion on #95299.

Review details

Best possible solution:

Close this PR as superseded by #95299.

Do we have a high-confidence way to reproduce the issue?

Yes. Source inspection shows current main keeps other-live-process Telegram claims guarded while later same-lane updates remain pending, and Mantis before/after proof shows the visible stuck-message recovery on this PR.

Is this the best way to solve the issue?

No. The PR targets the right failure and has real Telegram proof, but age plus this process having no active handler is not enough stale-owner proof for another live worker without maintainer policy approval.

Security review:

Security review cleared: The diff changes Telegram runtime recovery logic and tests only; it adds no dependency, workflow, secret, permission, package, or remote code execution surface.

AGENTS.md: found and applied where relevant.

What I checked:

Likely related people:

  • vincentkoc: Current blame for the Telegram drain path and live-owner predicate points to the snapshot commit, and commit 4957286 specifically touched live spool claim owner preservation. (role: recent area contributor; confidence: high; commits: ebb670b20863, 49572863d3c1; files: extensions/telegram/src/polling-session.ts, extensions/telegram/src/telegram-ingress-spool.ts)
  • steipete: Commit b0679d1 introduced the SQLite channel ingress queue and schema that back the durable claim rows involved here. (role: introduced shared queue storage; confidence: high; commits: b0679d1f13da; files: src/channels/message/ingress-queue.ts, src/state/openclaw-state-schema.sql, extensions/telegram/src/telegram-ingress-spool.ts)
  • openperf: Commit 6f76d9f changed stuck-session lane recovery adjacent to the linked release_lane released=0 symptom. (role: adjacent diagnostic recovery contributor; confidence: medium; commits: 6f76d9f246a3; files: src/logging/diagnostic-stuck-session-recovery.runtime.ts, src/logging/diagnostic-session-recovery.ts)
  • obviyus: Commit d1b33a6 changed Telegram PID-reused ingress claim recovery near the live-owner liveness boundary. (role: adjacent Telegram recovery contributor; confidence: medium; commits: d1b33a6040a4; files: extensions/telegram/src/telegram-ingress-spool.ts, extensions/telegram/src/telegram-ingress-spool.test.ts)

Codex review notes: model internal, reasoning high; reviewed against 108d6d7eca00.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. mantis: telegram-visible-proof Mantis should capture Telegram visible proof. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. labels Jun 20, 2026
@clawsweeper
clawsweeper Bot temporarily deployed to qa-live-shared June 20, 2026 08:22 Inactive
@openclaw-mantis

Copy link
Copy Markdown
Contributor

Mantis Telegram Desktop Proof

Summary: Mantis captured native Telegram Desktop before/after GIFs showing Main leaving the stuck-lane message unanswered while This PR delivers a bot response.

Main screenshot This PR screenshot
Baseline native Telegram Desktop screenshot Candidate native Telegram Desktop screenshot
Main This PR
Baseline native Telegram Desktop proof GIF Candidate native Telegram Desktop proof GIF

Motion-trimmed clips:

Raw QA files: https://artifacts.openclaw.ai/mantis/telegram-desktop/pr-95282/run-27865455179-1/index.json

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 20, 2026
@clawsweeper

clawsweeper Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper applied the proposed close for this PR.

@clawsweeper clawsweeper Bot closed this Jun 27, 2026
@clawsweeper

clawsweeper Bot commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper could not autoclose this item.

Reason: structured ClawSweeper close marker: close-required (sha=66a9d60f5eca88b6a297a61ff1742cce85d6902c)

Usage: /autoclose <maintainer close reason>. I will close this item and any open same-repo items explicitly referenced in the command text.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: telegram Channel integration: telegram mantis: telegram-visible-proof Mantis should capture Telegram visible proof. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: S status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenClaw release_lane is a no-op when claim is held by a live worker; stuck Telegram inbound events block agent response until gateway restart

1 participant