问题:attempt > 0 应该是 attempt > 1 - attempt 从 range(1, max_retries + 1) 开始,值为 1, 2, 3 - 原条件 attempt > 0 在 attempt=1 时就为 True - 导致 elif 分支(首次尝试逻辑)成为死代码 修复: - 将 attempt > 0 改为 attempt > 1 - 更新注释使其更清晰准确 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
21 KiB
21 KiB