Skip to content

Commit 7196ef7

Browse files
committed
fix: tighten fallback selection to valid healthy providers
Made-with: Cursor
1 parent eeeb0a8 commit 7196ef7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/router.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export function routeModel(model: string, providers: Provider[]): RouteDecision
66
return { selectedProviderId: primary.id, fallbackUsed: false };
77
}
88

9-
const fallback = providers.find((p) => p.healthy);
9+
const fallback = providers.find((p) => p.healthy && p.models.length > 0);
1010
if (!fallback) {
1111
throw new Error("No healthy providers available");
1212
}

0 commit comments

Comments
 (0)