fix(auth): modify AI interface retry logic#1294
Open
buzz77 wants to merge 1 commit intoNoFxAiOS:devfrom
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
根据代码更改,这里是PR描述:
📝 Description | 描述
English: Modified AI API retry logic to retry on all errors instead of only specific retryable errors. The client will now attempt up to 4 total calls (1 initial + 3 retries) regardless of the error type returned by the AI API.
中文: 修改了AI API的重试逻辑,现在无论AI接口返回什么错误都会重试,而不仅仅是特定的可重试错误。客户端现在会尝试最多4次调用(1次初始调用 + 3次重试)。
🎯 Type of Change | 变更类型
🔗 Related Issues | 相关 Issue
📋 Changes Made | 具体变更
English:
isRetryableError()method to always returntrue, removing error type filteringMaxRetryTimesfrom3to4to ensure exactly 3 retries (4 total attempts)CallWithMessages()andCallWithRequest()methods中文:
isRetryableError()方法直接返回true,移除了错误类型过滤逻辑MaxRetryTimes从3改为4,确保重试3次(总共4次调用)CallWithMessages()和CallWithRequest()🧪 Testing | 测试
✅ Checklist | 检查清单
Code Quality | 代码质量
Documentation | 文档
Git
devbranch | 已 rebase 到最新dev分支📚 Additional Notes | 补充说明
English: The retry delay follows an exponential backoff pattern: 2s, 4s, 6s for the 1st, 2nd, and 3rd retry respectively. This change makes the retry behavior more aggressive to handle transient API failures more reliably.
中文: 重试延迟采用递增模式:第1次重试等待2秒,第2次重试等待4秒,第3次重试等待6秒。此变更使重试行为更加积极,以更可靠地处理临时的API故障。
By submitting this PR, I confirm | 提交此 PR,我确认:
🌟 Thank you for your contribution! | 感谢你的贡献!