fix: restore luker llm priority order

This commit is contained in:
Youzini-afk
2026-04-16 01:04:56 +08:00
parent 66a168773f
commit 622f00620c
4 changed files with 117 additions and 26 deletions

View File

@@ -1965,17 +1965,7 @@ async function callDedicatedOpenAICompatible(
profileName: config.requestedLlmPresetName || "",
});
const settings = extension_settings[MODULE_NAME] || {};
const shouldPreferLukerHostRoute =
hostRouting.hostProfile === "luker" &&
(
config.llmConfigSource === "global" ||
(
String(config.llmConfigSource || "").startsWith("global-fallback-") &&
hostRouting.routeApplied === true
)
);
const hasDedicatedConfig =
hasDedicatedLLMConfig(config) && !shouldPreferLukerHostRoute;
const hasDedicatedConfig = hasDedicatedLLMConfig(config);
if (taskType && config.llmPresetFallbackReason) {
debugWarn(
`[ST-BME] 任务 ${taskType} 指定的 API 模板不可用,已回退当前 API: ` +
@@ -2052,7 +2042,10 @@ async function callDedicatedOpenAICompatible(
hostRequestApi: hostRouting.requestApi,
hostRouteApplied: hostRouting.routeApplied,
hostRouteReason: hostRouting.routeReason,
preferHostRoute: shouldPreferLukerHostRoute,
preferHostRoute:
!hasDedicatedConfig &&
hostRouting.hostProfile === "luker" &&
hostRouting.routeApplied === true,
apiSettingsOverride: hostRouting.apiSettingsOverride,
maxCompletionTokens,
...buildStreamDebugSnapshot(streamState),