fix(model-fallback): enable by default and add missing error patterns for usage limits (#2393)
This commit is contained in:
@@ -153,7 +153,7 @@ export function createSessionHooks(args: {
|
||||
|
||||
// Model fallback hook (configurable via model_fallback config + disabled_hooks)
|
||||
// This handles automatic model switching when model errors occur
|
||||
const isModelFallbackConfigEnabled = pluginConfig.model_fallback ?? false
|
||||
const isModelFallbackConfigEnabled = pluginConfig.model_fallback ?? true
|
||||
const modelFallback = isModelFallbackConfigEnabled && isHookEnabled("model-fallback")
|
||||
? safeHook("model-fallback", () =>
|
||||
createModelFallbackHook({
|
||||
|
||||
@@ -55,9 +55,17 @@ const RETRYABLE_MESSAGE_PATTERNS = [
|
||||
"timeout",
|
||||
"service unavailable",
|
||||
"internal_server_error",
|
||||
"free usage",
|
||||
"usage exceeded",
|
||||
"credit",
|
||||
"balance",
|
||||
"temporarily unavailable",
|
||||
"try again",
|
||||
"503",
|
||||
"502",
|
||||
"504",
|
||||
"429",
|
||||
"529",
|
||||
]
|
||||
|
||||
const AUTO_RETRY_GATE_PATTERNS = [
|
||||
|
||||
Reference in New Issue
Block a user