Skip to content

fix: forward http_options in async_request_streamed to enable retry support#2097

Open
acoroleu-tempus wants to merge 3 commits intogoogleapis:mainfrom
acoroleu-tempus:acoroleu/issue-2044
Open

fix: forward http_options in async_request_streamed to enable retry support#2097
acoroleu-tempus wants to merge 3 commits intogoogleapis:mainfrom
acoroleu-tempus:acoroleu/issue-2044

Conversation

@acoroleu-tempus
Copy link

@acoroleu-tempus acoroleu-tempus commented Feb 25, 2026

Summary

  • Fixes RetryHttpOptions ignored for client.aio.models.generate_content_stream #2044 -- client.aio.models.generate_content_stream ignores HttpRetryOptions and performs no retries, while the sync client.models.generate_content_stream retries correctly.
  • Root cause: async_request_streamed did not pass http_options to _async_request, so per-request retry options were silently dropped.
  • One-line fix: forward the http_options parameter, matching what the sync request_streamed already does.

Test plan

  • Added 12 new streaming retry tests to test_retries.py covering:
    • Sync httpx streaming (4 tests, baseline reference)
    • Async httpx streaming (4 tests)
    • Async aiohttp streaming (4 tests)
    • Each backend tests both client-level and request-level retry options, for both successful and unsuccessful retry scenarios
  • Verified all 12 new tests fail before the fix and pass after
  • Verified all 38 tests in test_retries.py pass (26 existing + 12 new)

@google-cla
Copy link

google-cla bot commented Feb 25, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@Venkaiahbabuneelam Venkaiahbabuneelam self-assigned this Feb 25, 2026
@Venkaiahbabuneelam Venkaiahbabuneelam added the size:L Code changes between 40-100 lines label Feb 26, 2026
@Venkaiahbabuneelam
Copy link

Hi @acoroleu-tempus , Thanks for reaching out us!

Looks like branch is out of date, Kindly please update the branch.

Thanks

@acoroleu-tempus
Copy link
Author

@Venkaiahbabuneelam done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L Code changes between 40-100 lines status:awaiting user response

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RetryHttpOptions ignored for client.aio.models.generate_content_stream

2 participants