fix(failover): align abort timeout detection and regressions

This commit is contained in:
Sebastian
2026-02-16 20:59:44 -05:00
parent f242246839
commit fbda9a93fd
5 changed files with 40 additions and 1 deletions

View File

@@ -400,6 +400,17 @@ describe("runWithModelFallback", () => {
});
});
it("falls back on abort errors with reason: abort", async () => {
await expectFallsBackToHaiku({
provider: "openai",
model: "gpt-4.1-mini",
firstError: Object.assign(new Error("aborted"), {
name: "AbortError",
reason: "reason: abort",
}),
});
});
it("falls back when message says aborted but error is a timeout", async () => {
await expectFallsBackToHaiku({
provider: "openai",