Repository navigation
fix(telegram): honor abortSignal in startup probe retry loop - #109604
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 17, 2026, 2:50 AM ET / 06:50 UTC. Summary PR surface: Source +4, Tests +87. Total +91 across 3 files. Reproducibility: yes. at source level: current main's bare retry timer cannot observe the account abort signal, and the real-socket regression path demonstrates the extra-attempt failure mode. A full live gateway reproduction was not supplied. 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 plugin-owned signal wiring and focused regression coverage, then add a redacted gateway transcript showing a real Telegram account abort during probe backoff with prompt shutdown and no subsequent Do we have a high-confidence way to reproduce the issue? Yes at source level: current main's bare retry timer cannot observe the account abort signal, and the real-socket regression path demonstrates the extra-attempt failure mode. A full live gateway reproduction was not supplied. Is this the best way to solve the issue? Yes: forwarding the existing owner signal and using the shared abortable-delay helper is the narrowest maintainable fix, with no new configuration, SDK contract, or competing retry implementation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 9ac2f77487fa. Label changesLabel justifications:
Evidence reviewedPR surface: Source +4, Tests +87. Total +91 across 3 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
Review history (1 earlier review cycle)
|
c3584b9 to
019d29b
Compare
|
Merged via squash.
|
…w#109604) * fix(telegram): honor abortSignal in startup probe retry loop * test(telegram): isolate probe retry abort proof * fix(telegram): abort active startup probe requests --------- Co-authored-by: Peter Steinberger <[email protected]>
…w#109604) * fix(telegram): honor abortSignal in startup probe retry loop * test(telegram): isolate probe retry abort proof * fix(telegram): abort active startup probe requests --------- Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
extensions/telegram/src/probe.tshas a retry loop for the initialgetMecall that waits on a baresetTimeout. When a Telegram account startup is aborted (e.g. gateway shutdown, account removal, or session cancellation), the probe keeps sleeping through its full retry backoff and may issue additionalgetMerequests even though the result will be discarded. This wastes resources and delays shutdown.Why This Change Was Made
The
startAccountcaller inextensions/telegram/src/channel.tsalready ownsctx.abortSignaland passes it to the startup probe concurrency limiter, but it never reachedprobeTelegram. This change threads the signal throughTelegramProbeOptionsand replaces the baresetTimeoutwithsleepWithAbortfromopenclaw/plugin-sdk/runtime-env, the same helper already used throughout the Telegram plugin (polling, webhook, delivery, ingress spool).This follows the same pattern as recent merged fixes in sibling plugins:
abortSignalthrough comment-event handlers and used an abortable delay in the comment reply retry loop.setTimeoutinwaitForGatewayReadywithsleepWithAbortso gateway shutdown interrupts the READY retry backoff.User Impact
Telegram account startup now respects cancellation promptly. If an account is stopped while the startup probe is retrying a network/DNS stall, the retry loop exits as soon as the abort signal fires instead of waiting out the remaining backoff and firing another
getMerequest.Evidence
Before (
probe.tsretry delay):The delay could not be interrupted, so a second
getMefetch could be issued after abort.After:
The loop now exits immediately when the owning
AbortSignalaborts, and the transport is not promoted to a fallback dispatcher for an abort-induced error.Regression test:
extensions/telegram/src/probe.abort-signal.integration.test.tsstarts a local HTTP stub, destroys the first connection to force a retry, fires a realAbortControllerwhile the probe is in its backoff, and asserts that only onegetMerequest and one TCP connection are observed.Validation run: