mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 09:20:22 +08:00
Add provider key cycle stats reset handling
This commit is contained in:
@@ -731,6 +731,10 @@ fn local_candidate_failure_should_record_pool_error(
|
||||
classification: LocalFailoverClassification,
|
||||
status_code: u16,
|
||||
) -> bool {
|
||||
if status_code == 400 {
|
||||
return false;
|
||||
}
|
||||
|
||||
local_candidate_failure_should_invalidate_affinity(classification, status_code)
|
||||
}
|
||||
|
||||
@@ -1441,6 +1445,10 @@ mod tests {
|
||||
LocalFailoverClassification::StopErrorPattern,
|
||||
400,
|
||||
));
|
||||
assert!(!local_candidate_failure_should_record_pool_error(
|
||||
LocalFailoverClassification::RetryUpstreamFailure,
|
||||
400,
|
||||
));
|
||||
assert!(local_candidate_failure_should_record_pool_error(
|
||||
LocalFailoverClassification::RetryUpstreamFailure,
|
||||
429,
|
||||
|
||||
@@ -144,6 +144,9 @@ fn local_candidate_failure_should_project_health(
|
||||
if status_code < 400 {
|
||||
return false;
|
||||
}
|
||||
if status_code == 400 {
|
||||
return false;
|
||||
}
|
||||
|
||||
match classification {
|
||||
LocalFailoverClassification::RetrySuccessPattern
|
||||
@@ -216,6 +219,18 @@ mod tests {
|
||||
.is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn failure_projection_ignores_client_bad_request() {
|
||||
assert!(project_local_failure_health(
|
||||
None,
|
||||
"openai:chat",
|
||||
LocalFailoverClassification::RetryUpstreamFailure,
|
||||
400,
|
||||
1_760_000_000,
|
||||
)
|
||||
.is_none());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn success_projection_resets_only_target_format() {
|
||||
let projected = project_local_success_health(
|
||||
|
||||
Reference in New Issue
Block a user