fix(agents): harden model fallback failover paths

This commit is contained in:
Peter Steinberger
2026-02-25 03:46:34 +00:00
parent 480cc4b85c
commit d2597d5ecf
10 changed files with 187 additions and 11 deletions

View File

@@ -433,6 +433,12 @@ describe("classifyFailoverReason", () => {
expect(classifyFailoverReason("Missing scopes: model.request")).toBe("auth");
expect(classifyFailoverReason("429 too many requests")).toBe("rate_limit");
expect(classifyFailoverReason("resource has been exhausted")).toBe("rate_limit");
expect(
classifyFailoverReason("model_cooldown: All credentials for model gpt-5 are cooling down"),
).toBe("rate_limit");
expect(classifyFailoverReason("all credentials for model x are cooling down")).toBe(
"rate_limit",
);
expect(
classifyFailoverReason(
'{"type":"error","error":{"type":"overloaded_error","message":"Overloaded"}}',