Skip to content

fix(channels): bound send_status timeout and add Telegram 429 retry#6113

Merged
bug-ops merged 1 commit into
mainfrom
fix/6094-channel-send-retry-timeout
Jul 12, 2026
Merged

fix(channels): bound send_status timeout and add Telegram 429 retry#6113
bug-ops merged 1 commit into
mainfrom
fix/6094-channel-send-retry-timeout

Conversation

@bug-ops

@bug-ops bug-ops commented Jul 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add Channel::send_status_best_effort, a default trait method wrapping send_status in a 10s tokio::time::timeout with debug/warn logging, replacing ~45 silent let _ = 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.
  • Add crates/zeph-channels/src/common/teloxide_retry.rs::send_teloxide_with_retry, a retry helper matching teloxide::RequestError::RetryAfter, so Telegram's send/send_status/send_or_edit get the same 429 backoff Slack/Discord already had via http_retry::send_with_retry.
  • Add a test-injectable base_url + #[cfg(test)] with_base_url constructor to Discord's RestClient, mirroring the existing Slack/Telegram pattern, plus wiremock tests proving send_message/edit_message/trigger_typing retry transparently on a 429.

Closes #6094
Closes #6106
Closes #6095

Test plan

  • cargo +nightly fmt --check
  • cargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warnings
  • cargo 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"
  • New tests: send_status_best_effort success/error/timeout (incl. tracing-output assertions via tracing-test), Telegram real-path 429 retry test, 3 Discord wiremock retry tests
  • .local/testing/playbooks/channels.md and .local/testing/coverage-status.md updated
  • CHANGELOG.md updated

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.
@github-actions github-actions Bot added bug Something isn't working size/XL Extra large PR (500+ lines) documentation Improvements or additions to documentation channels zeph-channels crate (Telegram) rust Rust code changes core zeph-core crate dependencies Dependency updates and removed size/XL Extra large PR (500+ lines) labels Jul 11, 2026
@bug-ops
bug-ops enabled auto-merge (squash) July 11, 2026 23:57
@bug-ops
bug-ops merged commit ccf0676 into main Jul 12, 2026
43 checks passed
@bug-ops
bug-ops deleted the fix/6094-channel-send-retry-timeout branch July 12, 2026 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working channels zeph-channels crate (Telegram) core zeph-core crate dependencies Dependency updates documentation Improvements or additions to documentation rust Rust code changes

Projects

None yet

1 participant