fix(core): apply retry logic to CodeAssistServer for all users#20507
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses an oversight in the existing retry logic, ensuring that OAuth users now benefit from the same robust error handling as API key and Vertex AI users. It specifically extends the retry mechanism within the Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request correctly extends the retry logic to include 499 errors and applies it to OAuth users in CodeAssistServer, ensuring consistent error handling across all authentication types. The accompanying test updates are thorough and validate the new behavior. I've included a couple of suggestions to refactor duplicated logic, which will improve the long-term maintainability of the new retry mechanism.
|
Size Change: +436 B (0%) Total Size: 25.7 MB ℹ️ View Unchanged
|
This is a follow-up to PR #20432.
Summary
The original PR for handling 499 errors was merged, but it was discovered that the retry logic was only being applied to API key and Vertex AI users, not OAuth users. This PR corrects that oversight.
Details
packages/core/src/code_assist/server.ts: Added aretryConfigto thegaxiosrequests withinCodeAssistServer. This ensures that OAuth users' requests will now automatically retry on 429 and 499 status codes, aligning their experience with that of API key users.Related Issues
How to Validate
packages/core/src/code_assist/server.ts.npm test -w @google/gemini-cli-core -- src/code_assist/server.test.tsto confirm tests still pass.Pre-Merge Checklist