Merge pull request #2422 from MoerAI/fix/issue-2393-model-fallback-defaults

fix(model-fallback): enable by default and add missing error patterns for usage limits
This commit is contained in:
YeonGyu-Kim
2026-03-12 01:32:34 +09:00
committed by GitHub
2 changed files with 9 additions and 1 deletions

View File

@@ -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({

View File

@@ -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 = [