feat(model-fallback): disable model fallback retry by default

Model fallback is now opt-in via `model_fallback: true` in plugin config,
matching the runtime-fallback pattern. Prevents unexpected automatic model
switching on API errors unless explicitly enabled.
This commit is contained in:
YeonGyu-Kim
2026-02-22 17:25:04 +09:00
parent 2e845c8d99
commit 9933c6654f
4 changed files with 75 additions and 7 deletions
+3 -2
View File
@@ -151,9 +151,10 @@ export function createSessionHooks(args: {
}
}
// Model fallback hook (configurable via disabled_hooks)
// Model fallback hook (configurable via model_fallback config + disabled_hooks)
// This handles automatic model switching when model errors occur
const modelFallback = isHookEnabled("model-fallback")
const isModelFallbackConfigEnabled = pluginConfig.model_fallback ?? false
const modelFallback = isModelFallbackConfigEnabled && isHookEnabled("model-fallback")
? safeHook("model-fallback", () =>
createModelFallbackHook({
toast: async ({ title, message, variant, duration }) => {