Fix combo fallback
This commit is contained in:
@@ -24,6 +24,11 @@ export function checkFallbackError(status, errorText, backoffLevel = 0) {
|
|||||||
const errorStr = typeof errorText === "string" ? errorText : JSON.stringify(errorText);
|
const errorStr = typeof errorText === "string" ? errorText : JSON.stringify(errorText);
|
||||||
const lowerError = errorStr.toLowerCase();
|
const lowerError = errorStr.toLowerCase();
|
||||||
|
|
||||||
|
// "No credentials" - should fallback to next model in combo
|
||||||
|
if (lowerError.includes("no credentials")) {
|
||||||
|
return { shouldFallback: true, cooldownMs: COOLDOWN_MS.notFound };
|
||||||
|
}
|
||||||
|
|
||||||
// "Request not allowed" - short cooldown (5s), takes priority over status code
|
// "Request not allowed" - short cooldown (5s), takes priority over status code
|
||||||
if (lowerError.includes("request not allowed")) {
|
if (lowerError.includes("request not allowed")) {
|
||||||
return { shouldFallback: true, cooldownMs: COOLDOWN_MS.requestNotAllowed };
|
return { shouldFallback: true, cooldownMs: COOLDOWN_MS.requestNotAllowed };
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { useState } from "react";
|
import { useState, Suspense } from "react";
|
||||||
import { UsageStats, RequestLogger } from "@/shared/components";
|
import { UsageStats, RequestLogger } from "@/shared/components";
|
||||||
|
|
||||||
export default function UsagePage() {
|
export default function UsagePage() {
|
||||||
@@ -33,7 +33,9 @@ export default function UsagePage() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Content */}
|
{/* Content */}
|
||||||
{activeTab === "overview" ? <UsageStats /> : <RequestLogger />}
|
<Suspense fallback={<div className="text-text-muted">Loading...</div>}>
|
||||||
|
{activeTab === "overview" ? <UsageStats /> : <RequestLogger />}
|
||||||
|
</Suspense>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user