Fix combo fallback

This commit is contained in:
decolua
2026-01-19 23:01:39 +07:00
parent 3804357aba
commit e6ca119f5e
2 changed files with 9 additions and 2 deletions

View File

@@ -24,6 +24,11 @@ export function checkFallbackError(status, errorText, backoffLevel = 0) {
const errorStr = typeof errorText === "string" ? errorText : JSON.stringify(errorText);
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
if (lowerError.includes("request not allowed")) {
return { shouldFallback: true, cooldownMs: COOLDOWN_MS.requestNotAllowed };

View File

@@ -1,6 +1,6 @@
"use client";
import { useState } from "react";
import { useState, Suspense } from "react";
import { UsageStats, RequestLogger } from "@/shared/components";
export default function UsagePage() {
@@ -33,7 +33,9 @@ export default function UsagePage() {
</div>
{/* Content */}
{activeTab === "overview" ? <UsageStats /> : <RequestLogger />}
<Suspense fallback={<div className="text-text-muted">Loading...</div>}>
{activeTab === "overview" ? <UsageStats /> : <RequestLogger />}
</Suspense>
</div>
);
}