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)
|
// Model fallback hook (configurable via model_fallback config + disabled_hooks)
|
||||||
// This handles automatic model switching when model errors occur
|
// 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")
|
const modelFallback = isModelFallbackConfigEnabled && isHookEnabled("model-fallback")
|
||||||
? safeHook("model-fallback", () =>
|
? safeHook("model-fallback", () =>
|
||||||
createModelFallbackHook({
|
createModelFallbackHook({
|
||||||
|
|||||||
@@ -55,9 +55,17 @@ const RETRYABLE_MESSAGE_PATTERNS = [
|
|||||||
"timeout",
|
"timeout",
|
||||||
"service unavailable",
|
"service unavailable",
|
||||||
"internal_server_error",
|
"internal_server_error",
|
||||||
|
"free usage",
|
||||||
|
"usage exceeded",
|
||||||
|
"credit",
|
||||||
|
"balance",
|
||||||
|
"temporarily unavailable",
|
||||||
|
"try again",
|
||||||
"503",
|
"503",
|
||||||
"502",
|
"502",
|
||||||
"504",
|
"504",
|
||||||
|
"429",
|
||||||
|
"529",
|
||||||
]
|
]
|
||||||
|
|
||||||
const AUTO_RETRY_GATE_PATTERNS = [
|
const AUTO_RETRY_GATE_PATTERNS = [
|
||||||
|
|||||||
Reference in New Issue
Block a user