From 067c8010bec3892f5ce58505bfb8fff09c997b37 Mon Sep 17 00:00:00 2001 From: "youming.tang" Date: Mon, 9 Feb 2026 17:47:06 +0900 Subject: [PATCH] fix: resolve merge conflicts in PR #1408 - Fix bun.lock version conflicts (3.3.1 -> 3.3.2) - Remove Git conflict markers from docs/configurations.md - Remove duplicate normalizeFallbackModels, import from shared module --- src/hooks/runtime-fallback/index.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/hooks/runtime-fallback/index.ts b/src/hooks/runtime-fallback/index.ts index 3bbc9af10..134aaeb13 100644 --- a/src/hooks/runtime-fallback/index.ts +++ b/src/hooks/runtime-fallback/index.ts @@ -4,6 +4,7 @@ import type { FallbackState, FallbackResult, RuntimeFallbackHook, RuntimeFallbac import { DEFAULT_CONFIG, RETRYABLE_ERROR_PATTERNS, HOOK_NAME } from "./constants" import { log } from "../../shared/logger" import { SessionCategoryRegistry } from "../../shared/session-category-registry" +import { normalizeFallbackModels } from "../../shared/model-resolver" function createFallbackState(originalModel: string): FallbackState { return { @@ -74,12 +75,6 @@ function isRetryableError(error: unknown, retryOnErrors: number[]): boolean { return RETRYABLE_ERROR_PATTERNS.some((pattern) => pattern.test(message)) } -function normalizeFallbackModels(models: string | string[] | undefined): string[] { - if (!models) return [] - const list = Array.isArray(models) ? models : [models] - return list.filter((m): m is string => typeof m === "string" && m.length > 0) -} - function getFallbackModelsForSession( sessionID: string, agent: string | undefined, @@ -92,7 +87,7 @@ function getFallbackModelsForSession( if (sessionCategory && pluginConfig.categories?.[sessionCategory]) { const categoryConfig = pluginConfig.categories[sessionCategory] if (categoryConfig?.fallback_models) { - return normalizeFallbackModels(categoryConfig.fallback_models) + return normalizeFallbackModels(categoryConfig.fallback_models) ?? [] } }