Problem or Use Case
问题根源:HTTP 529 没有触发 Fallback
代码逻辑是这样的:
error_classifier.py 第 488 行:
python if status_code in (503, 529): return result_fn(FailoverReason.overloaded, retryable=True) → 529 被分类为 overloaded,不是 rate_limit
run_agent.py 第 9181-9185 行:
python is_rate_limited = classified.reason in ( FailoverReason.rate_limit, FailoverReason.billing, ) if is_rate_limited and self._fallback_index < len(self._fallback_chain): → Fallback 只在 rate_limit 或 billing 时触发,overloaded 不在内!
所以 529 的处理流程是:
529 → FailoverReason.overloaded → 重试 3 次(exponential backoff)→ 失败,不触发 fallback
结论:529 错误时,fallback 模型没有切换。
Proposed Solution
🛠️ 如何修复
需要在 fallback 逻辑中也加入 overloaded 的判断。有两个方案:
方案 A:修改 is_rate_limited 判断,把 overloaded 也加进去(推荐,因为 529 和 429 一样是临时性过载)
方案 B:给 529 单独分类为 rate_limit,让它走同样的 fallback 逻辑
你想让我直接帮你改代码吗?
Alternatives Considered
No response
Feature Type
New tool
Scope
Small (single file, < 50 lines)
Contribution
Debug Report (optional)
Problem or Use Case
问题根源:HTTP 529 没有触发 Fallback
代码逻辑是这样的:
error_classifier.py 第 488 行:
python if status_code in (503, 529): return result_fn(FailoverReason.overloaded, retryable=True) → 529 被分类为 overloaded,不是 rate_limit
run_agent.py 第 9181-9185 行:
python is_rate_limited = classified.reason in ( FailoverReason.rate_limit, FailoverReason.billing, ) if is_rate_limited and self._fallback_index < len(self._fallback_chain): → Fallback 只在 rate_limit 或 billing 时触发,overloaded 不在内!
所以 529 的处理流程是:
529 → FailoverReason.overloaded → 重试 3 次(exponential backoff)→ 失败,不触发 fallback
结论:529 错误时,fallback 模型没有切换。
Proposed Solution
🛠️ 如何修复
需要在 fallback 逻辑中也加入 overloaded 的判断。有两个方案:
方案 A:修改 is_rate_limited 判断,把 overloaded 也加进去(推荐,因为 529 和 429 一样是临时性过载)
方案 B:给 529 单独分类为 rate_limit,让它走同样的 fallback 逻辑
你想让我直接帮你改代码吗?
Alternatives Considered
No response
Feature Type
New tool
Scope
Small (single file, < 50 lines)
Contribution
Debug Report (optional)