mirror of
https://github.com/decolua/9router.git
synced 2026-05-08 12:01:28 +00:00
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 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 };
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user