修复: force_send单锁竞态+classify unknown不重试(撤销误判)+UX交互批
This commit is contained in:
@@ -428,9 +428,12 @@ fn classify_status_or_class(status_or_class: &str) -> bool {
|
||||
}
|
||||
i += 1;
|
||||
}
|
||||
// 无三位数字码:按文本分类(timeout/connect 可重试,unknown/其他保守可重试)
|
||||
// 无三位数字码:按文本分类(timeout/connect 可重试,unknown/其他保守不重试)
|
||||
// BUG-260617-01:Anthropic 中文参数错误(如 `[1214][messages 参数非法]`)无 HTTP 数字前缀,
|
||||
// 走此文本分支,原 || true 致 retryable=true 空耗 4 次重试浪费 token。
|
||||
// 删 || true 对齐 retry::is_status_retryable 未知码不可重试语义;timeout/connect 瞬态仍可重试。
|
||||
let lower = status_or_class.to_lowercase();
|
||||
lower.contains("timeout") || lower.contains("connect") || true // unknown 保守可重试
|
||||
lower.contains("timeout") || lower.contains("connect") // unknown 保守不重试(BUG-260617-01)
|
||||
}
|
||||
|
||||
// ============================================================
|
||||
@@ -471,10 +474,10 @@ mod tests {
|
||||
assert!(classify_status_or_class("connect"));
|
||||
}
|
||||
|
||||
/// unknown → 保守 retryable=true(不误判 Fatal 错杀)
|
||||
/// unknown → 保守 retryable=false(BUG-260617-01:防 Anthropic 中文参数错误等 Fatal 空耗重试)
|
||||
#[test]
|
||||
fn classify_unknown_retryable() {
|
||||
assert!(classify_status_or_class("unknown"));
|
||||
fn classify_unknown_not_retryable() {
|
||||
assert!(!classify_status_or_class("unknown"));
|
||||
}
|
||||
|
||||
// ---- extract_error_diag:业务层 bail(provider 串已含状态码)----
|
||||
|
||||
Reference in New Issue
Block a user