fix(channels): bound send_status timeout and add Telegram 429 retry#6113
Merged
Conversation
Wrap channel.send_status in a 10s timeout with debug/warn logging via a new Channel::send_status_best_effort default method, replacing ~45 silent `let _ = ...` discard sites on the agent turn hot path. Add a teloxide-specific retry helper so Telegram's send/edit paths get the same 429 backoff Slack/Discord already have. Give Discord's RestClient a test-injectable base_url, mirroring Slack, with wiremock retry tests for send_message/edit_message/trigger_typing.
bug-ops
enabled auto-merge (squash)
July 11, 2026 23:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Channel::send_status_best_effort, a default trait method wrappingsend_statusin a 10stokio::time::timeoutwith debug/warn logging, replacing ~45 silentlet _ = self.channel.send_status(...).await;discard sites across the agent turn hot path. This bounds the previously-unbounded (~255s worst case) stall a rate-limited status send could cause, and gives every call site failure visibility for free.crates/zeph-channels/src/common/teloxide_retry.rs::send_teloxide_with_retry, a retry helper matchingteloxide::RequestError::RetryAfter, so Telegram'ssend/send_status/send_or_editget the same 429 backoff Slack/Discord already had viahttp_retry::send_with_retry.base_url+#[cfg(test)] with_base_urlconstructor to Discord'sRestClient, mirroring the existing Slack/Telegram pattern, plus wiremock tests provingsend_message/edit_message/trigger_typingretry transparently on a 429.Closes #6094
Closes #6106
Closes #6095
Test plan
cargo +nightly fmt --checkcargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warningscargo nextest run --config-file .github/nextest.toml --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins(12986 passed, 0 failed)RUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace --features "desktop,ide,server,chat,pdf,scheduler"send_status_best_effortsuccess/error/timeout (incl. tracing-output assertions viatracing-test), Telegram real-path 429 retry test, 3 Discord wiremock retry tests.local/testing/playbooks/channels.mdand.local/testing/coverage-status.mdupdatedCHANGELOG.mdupdated