Skip to content

fix(auth): modify AI interface retry logic#1294

Open
buzz77 wants to merge 1 commit intoNoFxAiOS:devfrom
buzz77:feature/buzz
Open

fix(auth): modify AI interface retry logic#1294
buzz77 wants to merge 1 commit intoNoFxAiOS:devfrom
buzz77:feature/buzz

Conversation

@buzz77
Copy link

@buzz77 buzz77 commented Dec 30, 2025

根据代码更改,这里是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 | 变更类型

  • 🐛 Bug fix | 修复 Bug
  • ✨ New feature | 新功能
  • 💥 Breaking change | 破坏性变更
  • 📝 Documentation update | 文档更新
  • 🎨 Code style update | 代码样式更新
  • ♻️ Refactoring | 重构
  • ⚡ Performance improvement | 性能优化
  • ✅ Test update | 测试更新
  • 🔧 Build/config change | 构建/配置变更
  • 🔒 Security fix | 安全修复

🔗 Related Issues | 相关 Issue

  • Closes # | 关闭 #
  • Related to # | 相关 #

📋 Changes Made | 具体变更

English:

  • Modified isRetryableError() method to always return true, removing error type filtering
  • Changed MaxRetryTimes from 3 to 4 to ensure exactly 3 retries (4 total attempts)
  • Affects both CallWithMessages() and CallWithRequest() methods

中文:

  • 修改 isRetryableError() 方法直接返回 true,移除了错误类型过滤逻辑
  • MaxRetryTimes3 改为 4,确保重试3次(总共4次调用)
  • 影响两个方法:CallWithMessages()CallWithRequest()

🧪 Testing | 测试

  • Tested locally | 本地测试通过
  • Tests pass | 测试通过
  • Verified no existing functionality broke | 确认没有破坏现有功能

✅ Checklist | 检查清单

Code Quality | 代码质量

  • Code follows project style | 代码遵循项目风格
  • Self-review completed | 已完成代码自查
  • Comments added for complex logic | 已添加必要注释

Documentation | 文档

  • Updated relevant documentation | 已更新相关文档

Git

  • Commits follow conventional format | 提交遵循 Conventional Commits 格式
  • Rebased on latest dev branch | 已 rebase 到最新 dev 分支
  • No merge conflicts | 无合并冲突

📚 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,我确认:

  • I have read the Contributing Guidelines | 已阅读贡献指南
  • I agree to the Code of Conduct | 同意行为准则
  • My contribution is licensed under AGPL-3.0 | 贡献遵循 AGPL-3.0 许可证

🌟 Thank you for your contribution! | 感谢你的贡献!

@cla-assistant
Copy link

cla-assistant bot commented Dec 30, 2025

CLA assistant check
All committers have signed the CLA.

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.

1 participant