Skip to content

fix(channels): add 429 retry-with-backoff and Telegram send_status#6100

Merged
bug-ops merged 1 commit into
mainfrom
fix/5949-telegram-channel-adapter-gaps
Jul 11, 2026
Merged

fix(channels): add 429 retry-with-backoff and Telegram send_status#6100
bug-ops merged 1 commit into
mainfrom
fix/5949-telegram-channel-adapter-gaps

Conversation

@bug-ops

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

Copy link
Copy Markdown
Owner

Summary

  • Extract Discord's existing 429 retry-with-backoff (send_with_retry, fix(channels): Discord REST client missing 429 rate-limit handling #4728) into a shared crates/zeph-channels/src/common/http_retry.rs helper and wire it into Telegram's raw API extension client (TelegramApiClient::post) and all four SlackApi methods (auth_test, post_message, update_message, download_file), which previously surfaced a rate-limited response as a hard error on the first attempt.
  • Implement TelegramChannel::send_status, mirroring the existing Discord/Slack pattern, so Telegram users get the same visibility into background/implicit agent operations (skill reload, MCP elicitation, memory recall, etc.) that Discord/Slack users already see.

Closes #5949
Closes #5923

Details

  • SlackApi gained a base_url field (#[cfg(test)]-only override) for wiremock testability, and its previous per-call tokio::time::timeout(15s) was replaced with a per-attempt .timeout(15s) on the RequestBuilder, since an outer timeout is incompatible with a retry loop that can legitimately run longer than one request when backing off. Worst-case wall-clock under sustained 429 is documented on the shared helper.
  • TelegramChannel::send_status posts the status text as a plain-text message and no-ops when the text is empty, there is no active chat, or the channel is in a Guest Mode context (a guest reply can only be sent once via answerGuestQuery).
  • Slack's Web API error messages changed shape from custom strings to reqwest::Error text (necessary to reconcile per-call timeouts with the retry loop); signatures are unchanged, and no external consumer depends on the old text (verified by grep).

Follow-ups filed during review

Test plan

  • cargo nextest run --config-file .github/nextest.toml -p zeph-channels --features "discord,slack" — 275/275 pass (34 new/changed tests: shared retry helper, Telegram retry, Slack retry + host-check-reject + debug-redaction, 4 send_status tests)
  • cargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warnings — clean
  • cargo nextest run --config-file .github/nextest.toml --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins — 12945/12945 pass
  • cargo +nightly fmt --check — clean
  • RUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace --features "desktop,ide,server,chat,pdf,scheduler" — clean
  • RUSTFLAGS="-D warnings" cargo check --workspace --all-targets --features desktop,ide,server,chat,pdf,scheduler --locked — clean
  • cargo test --doc --workspace --features "desktop,ide,server,chat,pdf,scheduler" — clean
  • RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --features "discord,slack" -p zeph-channels — clean
  • CHANGELOG.md updated ([Unreleased]/Fixed)
  • .local/testing/playbooks/telegram-channel.md and .local/testing/playbooks/slack.md updated with new scenarios (429 retry, send_status)
  • .local/testing/coverage-status.md updated with new rows (status: Untested — not yet live-session-verified against real Telegram/Slack APIs)

Extract Discord's existing 429 retry-with-backoff into a shared
common::http_retry::send_with_retry helper and wire it into Telegram's
raw API extension client and Slack's Web API client, which previously
surfaced a rate-limit response as a hard error on the first attempt.

Also implement TelegramChannel::send_status, mirroring the
Discord/Slack pattern, so Telegram users get the same visibility into
background/implicit agent operations as their peers.

Closes #5949
Closes #5923
@github-actions github-actions Bot added documentation Improvements or additions to documentation channels zeph-channels crate (Telegram) rust Rust code changes bug Something isn't working size/XL Extra large PR (500+ lines) labels Jul 11, 2026
@bug-ops
bug-ops enabled auto-merge (squash) July 11, 2026 21:24
@bug-ops
bug-ops merged commit 02e2856 into main Jul 11, 2026
43 checks passed
@bug-ops
bug-ops deleted the fix/5949-telegram-channel-adapter-gaps branch July 11, 2026 21:30
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) documentation Improvements or additions to documentation rust Rust code changes size/XL Extra large PR (500+ lines)

Projects

None yet

1 participant