Update policy so transient errors are not marked terminal#26066
Update policy so transient errors are not marked terminal#26066DavidAPierce merged 5 commits intomainfrom
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 improves the reliability of the CLI by adjusting how it handles transient API errors. By modifying the state transition logic, the system will now attempt to retry the currently selected model when encountering temporary failures, rather than immediately falling back to a different model. This ensures a more consistent user experience when using specific models like Gemini Pro Preview. Highlights
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. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request updates the default state transition for transient errors from terminal to sticky_retry across the core availability policy catalog and multiple model configurations. Corresponding unit tests in policyCatalog.test.ts have also been updated to reflect this change. I have no feedback to provide.
|
Size Change: +28 B (0%) Total Size: 33.9 MB
ℹ️ View Unchanged
|
|
/patch preview |
|
🚀 [Step 1/4] Patch workflow(s) waiting for approval! 📋 Details:
⏳ Status: The patch creation workflow has been triggered and is waiting for deployment approval. Please visit the specific workflow links below and approve the runs. 🔗 Track Progress: |
|
🚀 [Step 2/4] Patch PR Created! 📋 Patch Details:
📝 Next Steps:
🔗 Track Progress: |
|
🚀 [Step 3/4] Patch Release Waiting for Approval! 📋 Release Details:
⏳ Status: The patch release has been triggered and is waiting for deployment approval. Please visit the specific workflow run link below and approve the deployment. You'll receive another update when it completes. 🔗 Track Progress: |
|
✅ [Step 4/4] Patch Release Complete! 📦 Release Details:
🎉 Status: Your patch has been successfully released and published to npm! 📝 What's Available:
🔗 Links: |
Summary
Addresses an issue where the CLI would unexpectedly ignore user-selected models (like Gemini Pro Preview) and silently fall back to the Flash model during temporary API failures.
By updating the error handling policy to treat transient errors (like rate limits or 503s) as
sticky_retryinstead ofterminal, the policy engine will now retry the currently selected model rather than instantly degrading to the next fallback model in the chain.Details
DEFAULT_STATEinpackages/core/src/availability/policyCatalog.tsto transitiontransienterrors tosticky_retry.packages/core/src/config/defaultModelConfigs.ts.packages/core/src/availability/policyCatalog.test.tsto verify the new retry behavior explicitly (e.g., ensuring preview models triggersticky retries).
Related Issues
Fixes #25898
How to Validate
npm test packages/core/src/availability/policyCatalog.test.tstransienterrors in the policy catalog now returnsticky_retryinstead ofterminal.--modelflag or via config) and force a transient error (or simulate one), ensuring it retries instead of falling back to Flash.Pre-Merge Checklist