Skip to content

Improve Gemini API retry logging#698

Open
Shashank23123458867504 wants to merge 1 commit into
tirth8205:mainfrom
Shashank23123458867504:improve-gemini-retry
Open

Improve Gemini API retry logging#698
Shashank23123458867504 wants to merge 1 commit into
tirth8205:mainfrom
Shashank23123458867504:improve-gemini-retry

Conversation

@Shashank23123458867504

@Shashank23123458867504 Shashank23123458867504 commented Jul 21, 2026

Copy link
Copy Markdown

Pull Request

Linked issue

Closes #699

What & why

This PR improves the retry helper used by the Google embedding provider.

Changes

  • Refactored retryable status detection using any() over a centralized tuple of retryable status codes.
  • Improved retry logging by including the exception type.
  • Added debug logging for non-retryable exceptions.
  • Preserved the existing retry behavior and exponential backoff logic.

These changes improve the readability and maintainability of _call_with_retry() without changing its intended behavior.

How it was tested

The local development environment has not yet been fully configured, so I was not able to run the project's test suite, linting, or type checking. The change is localized to _call_with_retry() and preserves the existing retry semantics.

Checklist

  • Tests added for new functionality
  • All tests pass: uv run pytest tests/ --tb=short -q
  • Linting passes: uv run ruff check code_review_graph/
  • Type checking passes: uv run mypy code_review_graph/ --ignore-missing-imports --no-strict-optional
  • Lines are at most 100 characters
  • Docs updated where behaviour changed (README, docs/, docstrings)

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.

[Feature]: Improve diagnostics in Gemini embedding retry helper

1 participant