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:
Bryan Helmkamp 2026-03-04 11:34:18 -05:00
parent 9556dcdcb1
commit 93afb4bf6d

View file

@ -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]