Description
The Discord REST client (crates/zeph-channels/src/discord/rest.rs) uses .error_for_status()? to surface HTTP errors but has no handling for HTTP 429 (Too Many Requests) responses from the Discord API.
Discord's rate-limiting system returns a Retry-After header (in seconds) on 429 responses. Without handling this, the bot will permanently fail the current message send/edit and surface an error to the user rather than backing off and retrying.
By contrast, the Telegram adapter explicitly clamps stream_interval_ms to avoid hitting Telegram's rate limits (line 218 in telegram.rs).
Expected Behavior
On HTTP 429, the Discord REST client should:
- Parse the
Retry-After header (or response body retry_after field)
- Sleep for that duration (or a bounded maximum)
- Retry the request up to a configured limit
Actual Behavior
HTTP 429 is surfaced as a generic reqwest::Error via error_for_status(), causing the message operation to fail permanently.
Affected code
crates/zeph-channels/src/discord/rest.rs:96 .error_for_status()?
crates/zeph-channels/src/discord/rest.rs:118 .error_for_status()?
Environment
Description
The Discord REST client (
crates/zeph-channels/src/discord/rest.rs) uses.error_for_status()?to surface HTTP errors but has no handling for HTTP 429 (Too Many Requests) responses from the Discord API.Discord's rate-limiting system returns a
Retry-Afterheader (in seconds) on 429 responses. Without handling this, the bot will permanently fail the current message send/edit and surface an error to the user rather than backing off and retrying.By contrast, the Telegram adapter explicitly clamps
stream_interval_msto avoid hitting Telegram's rate limits (line 218 in telegram.rs).Expected Behavior
On HTTP 429, the Discord REST client should:
Retry-Afterheader (or response bodyretry_afterfield)Actual Behavior
HTTP 429 is surfaced as a generic
reqwest::Errorviaerror_for_status(), causing the message operation to fail permanently.Affected code
Environment