Repository navigation
fix(telegram): survive getUpdates conflicts in isolated polling ingress - #91997
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 10, 2026, 2:04 PM ET / 18:04 UTC. Summary PR surface: Source +48, Tests +103. Total +151 across 4 files. Reproducibility: yes. Current main’s getUpdates-only worker drops the numeric Bot API code, and the parent rethrows a 409 because it is not classified as a recoverable network error, which gives a high-confidence source reproduction path. Review metrics: none identified. 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 detailsBest possible solution: Keep the structured error code in the worker contract and the shared in-session recovery policy, then verify one redacted real Bot API 409 run shows webhook cleanup, transport rotation, continued polling, and accurate channel status before landing. Do we have a high-confidence way to reproduce the issue? Yes. Current main’s getUpdates-only worker drops the numeric Bot API code, and the parent rethrows a 409 because it is not classified as a recoverable network error, which gives a high-confidence source reproduction path. Is this the best way to solve the issue? Yes. Preserving the structured API code at the existing worker boundary and applying the already-established classic polling recovery invariant is narrower and safer than parsing error text or changing gateway-wide restart policy. AGENTS.md: found and applied where relevant. Codex review notes: reasoning high; reviewed against aeb537c28620. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +48, Tests +103. Total +151 across 4 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
|
5d366be to
95343e8
Compare
Summary
A getUpdates
409 Conflict(second poller on the same bot token, or a stale webhook) kills the whole Telegram account in isolated ingress mode — the default. The ingress worker flattens Bot API errors into a message string, so the parent session cannot tell a conflict apart from a fatal401and rethrows out ofrunUntilAbort(extensions/telegram/src/polling-session.ts). The core supervisor then burns one ofMAX_RESTART_ATTEMPTS = 10(preserved across auto-restarts,src/gateway/server-channels.ts) and eventually gives up permanently — while the classic polling cycle has always handled the same 409 in-session with webhook re-clear, transport rotation (#69787), and a duplicate-poller hint.Changes:
error_codeon getUpdates failures and posts it inpoll-errormessages (typed worker contract).lastError/connected), not just the gateway log. Previously a classic-path conflict loop showedconnected: truewith no error for up to 30 minutes, and the actionable diagnosis never reachedopenclaw channels status.Verification
node scripts/run-vitest.mjs extensions/telegram/src/polling-session.test.ts— 54 passed.origin/main, new tests kept):restarts isolated ingress on a getUpdates conflict instead of crashing the accountfails with the account-crash (runUntilAbortrejects withConflict: terminated by other getUpdates request); the status assertions in the classic conflict and stall tests fail with no patch published. All pass with this branch's code.check:changedgreen (tbx_01ktsa6ds3121d18zk2mq7470k): typecheck extensions + extension tests, oxlint, import cycles, guards.