fix(failover): handle unhandled stop reason error

This commit is contained in:
Peter Steinberger
2026-03-03 01:04:20 +00:00
parent ced267c5cb
commit a2fdc3415f
5 changed files with 19 additions and 3 deletions

View File

@@ -743,6 +743,14 @@ describe("runWithModelFallback", () => {
});
});
it("falls back on unhandled stop reason error responses", async () => {
await expectFallsBackToHaiku({
provider: "openai",
model: "gpt-4.1-mini",
firstError: new Error("Unhandled stop reason: error"),
});
});
it("falls back when message says aborted but error is a timeout", async () => {
await expectFallsBackToHaiku({
provider: "openai",