fix(telegram): make pre-connect network failures recoverable in send context#80529
fix(telegram): make pre-connect network failures recoverable in send context#80529Kailigithub wants to merge 1 commit into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed May 26, 2026, 12:52 AM ET / 04:52 UTC. Summary PR surface: Source 0, Tests +2. Total +2 across 2 files. Reproducibility: Do we have a high-confidence way to reproduce the issue? Source-level yes for the unit condition: current main expects the bare envelope to be false in send context and separately proves wrapped pre-connect errors retry through 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:
Proof guidance: Risk before merge
Maintainer options:
Next step before merge Security Review findings
Review detailsBest possible solution: Keep the send-context envelope guard; if more recovery is needed, extend the narrow Do we have a high-confidence way to reproduce the issue? Do we have a high-confidence way to reproduce the issue? Source-level yes for the unit condition: current main expects the bare envelope to be false in send context and separately proves wrapped pre-connect errors retry through Is this the best way to solve the issue? Is this the best way to solve the issue? No; broadening the generic recoverable regex loses the current send-safety boundary, while the maintainable path is to key safe retries to grammY's wrapped error details or other concrete pre-connect evidence. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 23e9bc8c0b61. Label changesLabel justifications:
Evidence reviewedPR surface: Source 0, Tests +2. Total +2 across 2 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
|
|
This pull request has been automatically marked as stale due to inactivity. |
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
|
@Kailigithub thanks for the PR. ClawSweeper is still waiting on real behavior proof before this can move forward. Useful proof can be a screenshot, short video, terminal output, copied live output, linked artifact, or redacted logs that show the changed behavior after the fix. Please redact private tokens, phone numbers, private endpoints, customer data, and anything else sensitive. Once proof is added to the PR body or a comment, ClawSweeper or a maintainer can re-check it. |
|
@Kailigithub thanks for the PR. ClawSweeper is still waiting on real behavior proof before this can move forward. Useful proof can be a screenshot, short video, terminal output, copied live output, linked artifact, or redacted logs that show the changed behavior after the fix. Please redact private tokens, phone numbers, private endpoints, customer data, and anything else sensitive. Once proof is added to the PR body or a comment, ClawSweeper or a maintainer can re-check it. |
Summary
grammy's Telegram bot library can emit bare
"Network request for 'X' failed!"errors for pre-connect failures (DNS resolution, TLS handshake, etc.) — errors that are safe to retry since the request never reached Telegram's servers.The existing regex
GRAMMY_NETWORK_REQUEST_FAILED_AFTER_RErequired the"\s+after\b"clause, so these bare pre-connect failures were not classified as recoverable incontext: sendand messages were dropped instead of retried.Fix
Relax the regex to make
"after"optional:Network request for 'sendMessage' failed after 2 attempts.Network request for 'sendMessage' failed!Network request for 'X' failed!The existing test case covering
"failed after N attempts."continues to pass — only the pre-connect failure path is corrected.Verification
"failed after N attempts."test case still passes (same behavior)Closes #80362