Repository navigation
[codex] harden Telegram transient recovery - #97270
ghitafilali wants to merge 2 commits into
Conversation
|
Codex review: needs changes before merge. Reviewed June 28, 2026, 5:31 PM ET / 21:31 UTC. Summary PR surface: Source +9, Tests +23, Docs +1. Total +33 across 5 files. Reproducibility: yes. at source level: current main preserves Bot API error_code on getUpdates failures, then exits polling when the classifier returns false for 5xx; current outbound message gateway options also time out at 10 seconds while Telegram text sends are bounded at 60 seconds. A live 502 replay was not run in this read-only review. Review metrics: 1 noteworthy metric.
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 findings
Review detailsBest possible solution: Keep the classifier and timeout alignment, but correct the troubleshooting sentence so it only promises retries for paths the implementation actually retries unless command-menu retry is intentionally added and tested. Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main preserves Bot API error_code on getUpdates failures, then exits polling when the classifier returns false for 5xx; current outbound message gateway options also time out at 10 seconds while Telegram text sends are bounded at 60 seconds. A live 502 replay was not run in this read-only review. Is this the best way to solve the issue? No, not as submitted: the runtime classifier and timeout changes are the right owner-boundary fix, but the docs currently promise command-menu 5xx retry behavior that the implementation does not provide. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a54919dcbc95. Label changesLabel justifications:
Evidence reviewedPR surface: Source +9, Tests +23, Docs +1. Total +33 across 5 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
|
|
Additional repro/context for the triage label:
|
|
@clawsweeper re-review Updated the PR with the second root-cause fix from the same incident: outbound message gateway timeout now waits long enough for bounded provider sends, preventing ambiguous 10s local gateway timeouts when Telegram itself is still timing out. Focused tests passing locally:
|
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review Re-checking this PR because the visible status appears stale after the second root-cause fix. Current live PR state I verified:
Re-assessment from today: I do not see a new code change needed in this PR. The latest local "not getting replies" investigation showed Telegram ingress/egress working and the final receipt delivered; that symptom is a separate long-running detached-ingest progress/receipt visibility issue, not a recurrence of the Telegram transient recovery bug fixed here. Please refresh the review verdict and labels against the current head SHA. |
|
This pull request has been automatically marked as stale due to inactivity. |
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: [codex] harden Telegram transient recovery This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
|
Closing due to inactivity. |
What Problem This Solves
OpenClaw can stay locally healthy while Telegram appears unresponsive when Telegram Bot API calls fail in two different transient ways:
The fix classifies Telegram Bot API HTTP 5xx responses as recoverable for polling/setup/control-plane contexts while keeping non-idempotent
sendcontext conservative. It also aligns the outbound message gateway default timeout with bounded provider sends, so callers receive the provider success/failure instead of an early local gateway timeout.Summary
sendcontext conservative to avoid duplicate visible messagesBad Gatewaytroubleshooting behavior for Telegram polling/startup instabilityEvidence
pnpm exec vitest run extensions/telegram/src/network-errors.test.tspasses: 53 testspnpm exec vitest run src/infra/outbound/message-gateway-options.test.tspasses: 3 testsBad Gateway | Telegram ingress worker exited with code 1after Bot API timeouts/502sopenclaw message send --channel telegram ... --jsonreturnedok: truewith a Telegram message idGatewayTransportError: gateway timeout after 10000msto the provider-levelOutboundDeliveryError: Network request for sendMessage failed!after the bounded provider timeoutgetMeprobes returned immediately, while the configured real bot token established TLS and then timed out with zero bytes. This points to a Telegram-side/token-specific provider hang; the PR keeps OpenClaw behavior bounded and diagnosable rather than wedged or ambiguous.pnpm check:changedfrom the earlier PR pass did not execute checks because the delegated Blacksmith Testboxcrabboxbinary failed its own sanity check before running