Skip to content

fix(models): map retry attempts to LiteLLM retries - #8336

Closed
laoyyu wants to merge 1 commit into
google:mainfrom
laoyyu:fix/litellm-retry-attempts
Closed

laoyyu wants to merge 1 commit into
google:mainfrom
laoyyu:fix/litellm-retry-attempts

Conversation

@laoyyu

@laoyyu laoyyu commented Nov 25, 2026

Copy link
Copy Markdown

Summary

  • Convert HttpRetryOptions.attempts from total attempts to LiteLLM's retry-only num_retries semantics.
  • Clamp attempts=1 to zero retries so exactly one request is sent.

Verification

  • python -m pytest tests/unittests/models/test_litellm.py -q -k 'http_options_retry_options or disables_retries_for_one_attempt' (2 passed)
  • python -m ruff check on changed files

AI assistance: Codex helped inspect the retry path and prepare the change and tests.

Fixes #8330

@google-cla

google-cla Bot commented Nov 25, 2026

Copy link
Copy Markdown

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.

@laoyyu

laoyyu commented Nov 25, 2026

Copy link
Copy Markdown
Author

Closing this as a duplicate of #8331, which was opened earlier and covers the same fix with broader attempts=0/1/2/5 coverage plus an end-to-end request-count check. Keeping the earlier PR as the canonical change avoids splitting review on issue #8330.

@laoyyu laoyyu closed this Nov 25, 2026
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.

LiteLlm retries even when HttpRetryOptions.attempts is 1

1 participant