Skip to content

Conversation

@daniel-lxs
Copy link
Member

Summary

Improves rate limit handling for Gemini and all OpenAI-compatible embedders by adding exponential backoff with jitter and retry support for transient errors.

Changes

  • Added 0-20% jitter to exponential backoff to prevent thundering herd
  • Extended retry support to HTTP 500, 502, 503, 504 errors (previously only 429)
  • Added isRetryableError() helper for centralized retry logic
  • Updated tests for new retry behavior

Benefits

  • Prevents synchronized retry storms during rate limits
  • Improves reliability by retrying transient server errors
  • Fully backward compatible

All tests pass ✅

- Add jitter (0-20%) to exponential backoff to prevent thundering herd
- Extend retry support to transient errors (500, 502, 503, 504)
- Add isRetryableError() helper method for centralized retry logic
- Update tests to cover new retry behavior and jitter functionality
- Improve reliability for Gemini and all OpenAI-compatible embedders
@delve-auditor
Copy link

delve-auditor bot commented Jul 16, 2025

No security or compliance issues detected. Reviewed everything up to ad6e5f2.

Security Overview
  • 🔎 Scanned files: 2 changed file(s)
Detected Code Changes
Change Type Relevant files
Enhancement ► openai-compatible.ts
    Add jitter to exponential backoff
    Extend retry support for transient errors
    Add isRetryableError() helper method
► openai-compatible.spec.ts
    Update tests for retry behavior and jitter
► ApiOptions.tsx
    Simplify model ID update logic
► SettingsView.tsx
    Modify change detection behavior

Reply to this PR with @delve-auditor followed by a description of what change you want and we'll auto-submit a change to this PR to implement it.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jul 16, 2025
@daniel-lxs daniel-lxs moved this from Triage to PR [Draft / In Progress] in Roo Code Roadmap Jul 16, 2025
@hannesrudolph hannesrudolph added PR - Draft / In Progress and removed Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. labels Jul 16, 2025
@daniel-lxs daniel-lxs closed this Jul 17, 2025
@github-project-automation github-project-automation bot moved this from PR [Draft / In Progress] to Done in Roo Code Roadmap Jul 17, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jul 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants