Description
PR #87 fixed the Retry-After HTTP-date ValueError (issue #62) at the two sites that issue named: src/entrabot/tools/rate_limit.py (the 429 retry transport) and src/entrabot/tools/email.py. It introduced a shared parse_retry_after() helper in rate_limit.py that accepts both delta-seconds and the RFC 9110 HTTP-date form.
However, the same unsafe pattern still lives at ~15 other call sites:
int(resp.headers.get("Retry-After", "60"))
src/entrabot/tools/teams.py — 13 occurrences (L374, L502, L778, L845, L932, L988, L1042, L1101, L1124, L1201, L1237, L1327, L1369)
src/entrabot/graph_helpers.py — L87 (int(resp.headers.get("Retry-After", "10")))
Each of these will raise ValueError and bypass the retry/backoff path if the server returns an HTTP-date Retry-After header (e.g. Wed, 21 Oct 2026 07:28:00 GMT), exactly the failure mode #62 described.
Suggested fix
Route all of these through the existing parse_retry_after() helper from src/entrabot/tools/rate_limit.py, preserving each site's current default (60s for teams.py, 10s for graph_helpers.py). Add regression coverage for the HTTP-date form at representative sites.
Context
Follow-up to #87 / #62. Out of scope for #87, which intentionally fixed only the two sites named in the original issue.
Description
PR #87 fixed the
Retry-AfterHTTP-dateValueError(issue #62) at the two sites that issue named:src/entrabot/tools/rate_limit.py(the 429 retry transport) andsrc/entrabot/tools/email.py. It introduced a sharedparse_retry_after()helper inrate_limit.pythat accepts both delta-seconds and the RFC 9110 HTTP-date form.However, the same unsafe pattern still lives at ~15 other call sites:
src/entrabot/tools/teams.py— 13 occurrences (L374, L502, L778, L845, L932, L988, L1042, L1101, L1124, L1201, L1237, L1327, L1369)src/entrabot/graph_helpers.py— L87 (int(resp.headers.get("Retry-After", "10")))Each of these will raise
ValueErrorand bypass the retry/backoff path if the server returns an HTTP-dateRetry-Afterheader (e.g.Wed, 21 Oct 2026 07:28:00 GMT), exactly the failure mode #62 described.Suggested fix
Route all of these through the existing
parse_retry_after()helper fromsrc/entrabot/tools/rate_limit.py, preserving each site's current default (60s for teams.py, 10s for graph_helpers.py). Add regression coverage for the HTTP-date form at representative sites.Context
Follow-up to #87 / #62. Out of scope for #87, which intentionally fixed only the two sites named in the original issue.