fix: surface stalled Telegram ingress backlog#82288
Conversation
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: no. high-confidence live reproduction was established in this review. Source inspection and the proposed tests show a clear synthetic path where a spooled handler blocks while worker getUpdates continues succeeding. Real behavior proof Next step before merge Security Review detailsBest possible solution: Keep the Telegram-plugin fix path, but require redacted live Telegram ingress/status proof before maintainer review or merge. Do we have a high-confidence way to reproduce the issue? No high-confidence live reproduction was established in this review. Source inspection and the proposed tests show a clear synthetic path where a spooled handler blocks while worker getUpdates continues succeeding. Is this the best way to solve the issue? Mostly yes: the fix belongs in the Telegram plugin polling/session health path and now preserves the reconnect delivery drain. It is not merge-ready until the live Telegram proof requirement is satisfied. Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against ba8a6499f02f. |
0b6881a to
7c9f901
Compare
|
Landed via rebase onto main.
Thanks @shellyrocklobster for the report. |
Summary
mainreconnect-drain behavior: successfulgetUpdatesstill drains queued outbound deliveries, but does not turn channel health green while the inbound spool remains wedged.Fixes #82175.
Verification
node scripts/run-vitest.mjs extensions/telegram/src/polling-session.test.ts extensions/telegram/src/status.test.ts extensions/telegram/src/polling-status.test.ts -- --reporter=verbose/Users/steipete/Projects/agent-scripts/skills/codex-review/scripts/codex-review --mode branchgit diff --checkgetUpdates/webhook contract; installed[email protected]and@grammyjs/[email protected]source/types for offset, stop, and sequential handling behavior.Real behavior proof
Behavior addressed: Telegram isolated polling no longer reports healthy solely from worker
getUpdatessuccess when main-thread spooled update handling wedges behind a stale same-lane handler.Real environment tested: Local OpenClaw checkout with Telegram plugin unit/runtime tests after rebasing on latest
origin/main.Exact steps or command run after this patch:
node scripts/run-vitest.mjs extensions/telegram/src/polling-session.test.ts extensions/telegram/src/status.test.ts extensions/telegram/src/polling-status.test.ts -- --reporter=verbose; Codex review command above;git diff --check.Evidence after fix: Focused tests pass 57/57, including backlog liveness, isolated-ingress restart, account-restart duplicate guard, outbound reconnect-drain integration, and distinct status issue coverage. Codex review returned clean with no accepted/actionable findings.
Observed result after fix: A stalled spooled backlog publishes a polling error and suppresses later worker poll-success health updates until the backlog drains; active spooled lanes remain blocked across a new account session in the same gateway process; successful polling can still drain queued outbound delivery retries.
What was not tested: Live Telegram Bot API end-to-end traffic was not run. Broad
pnpm check:changedwas not completed in this turn; the reviewer attemptedpnpm tsgo:extensions:test, but pnpm failed before type output with[ERROR] fetch failed.