Compare commits

...

1 Commits

Author SHA1 Message Date
YeonGyu-Kim
2bb211c979 fix: add max retry protection and session cleanup for model fallback 2026-02-21 02:27:27 +09:00

View File

@@ -55,6 +55,8 @@ const RETRYABLE_MESSAGE_PATTERNS = [
"504",
]
const MAX_FALLBACK_ATTEMPTS = 10
export interface ErrorInfo {
name?: string
message?: string
@@ -108,7 +110,10 @@ export function hasMoreFallbacks(
fallbackChain: FallbackEntry[],
attemptCount: number,
): boolean {
return attemptCount < fallbackChain.length
return (
attemptCount < fallbackChain.length &&
attemptCount < MAX_FALLBACK_ATTEMPTS
)
}
/**