Skip to content

Handle HTTP-date Retry-After at Graph call sites#95

Open
gaoflow wants to merge 1 commit into
microsoft:mainfrom
gaoflow:fix-89-retry-after-http-date-call-sites
Open

Handle HTTP-date Retry-After at Graph call sites#95
gaoflow wants to merge 1 commit into
microsoft:mainfrom
gaoflow:fix-89-retry-after-http-date-call-sites

Conversation

@gaoflow

@gaoflow gaoflow commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #89.

Follow-up to #87 / #62. #87 added parse_retry_after() and fixed the two call sites named in the original issue; this routes the remaining Retry-After parsing in teams.py and graph_helpers.py through the same helper so HTTP-date headers do not raise ValueError.

Preserved the existing defaults:

  • Teams 429 paths still default to 60 seconds when the header is missing/invalid.
  • graph_request() still defaults to 10 seconds.

Tests

I wrote the representative regression tests before the implementation; they failed with ValueError against the old int(...) parsing and pass after this change.

  • uv run --python 3.12 --extra dev python -m pytest tests/test_graph_helpers.py::TestGraphRequest::test_retry_on_429_with_http_date_retry_after tests/tools/test_teams.py::TestCreateOneOnOneChat::test_429_http_date_retry_after_raises_rate_limit -q
  • uv run --python 3.12 --extra dev python -m pytest tests/test_graph_helpers.py tests/tools/test_teams.py tests/tools/test_rate_limit.py tests/tools/test_email.py -q
  • uv run --python 3.12 --extra dev python -m pytest -v --tb=short (1534 passed, 1 skipped; existing async runtime warnings)
  • uv run --python 3.12 --extra dev ruff check .
  • git diff --check

@gaoflow gaoflow force-pushed the fix-89-retry-after-http-date-call-sites branch from da49d04 to ee0b76b Compare June 26, 2026 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tools: Retry-After HTTP-date parsing still missing at ~15 other call sites (teams.py, graph_helpers.py)

1 participant