mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-09-06 08:18:58 +00:00
Fix HTTP 529 (Overloaded) misclassified as non-retryable InvalidRequest
The Anthropic API returns HTTP 529 for overload conditions, but this status code was falling through to the catch-all which classified it as InvalidRequest (non-retryable). This meant neither LLM-level nor node-level retries would trigger, causing workflow nodes to fail immediately on transient overload errors. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
9556dcdcb1
commit
93afb4bf6d
1 changed files with 18 additions and 1 deletions
|
|
@ -212,7 +212,7 @@ pub fn error_from_status_code(
|
|||
}
|
||||
413 => ProviderErrorKind::ContextLength,
|
||||
429 => ProviderErrorKind::RateLimit,
|
||||
500..=504 => ProviderErrorKind::Server,
|
||||
500..=504 | 529 => ProviderErrorKind::Server,
|
||||
// For ambiguous status codes (400, 422, etc.), use message-based classification
|
||||
_ => {
|
||||
let lower_msg = detail.message.to_lowercase();
|
||||
|
|
@ -501,6 +501,23 @@ mod tests {
|
|||
..
|
||||
}
|
||||
));
|
||||
|
||||
let err = error_from_status_code(
|
||||
529,
|
||||
"Overloaded".into(),
|
||||
"anthropic".into(),
|
||||
None,
|
||||
None,
|
||||
None,
|
||||
);
|
||||
assert!(matches!(
|
||||
err,
|
||||
SdkError::Provider {
|
||||
kind: ProviderErrorKind::Server,
|
||||
..
|
||||
}
|
||||
));
|
||||
assert!(err.retryable());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue