修复自动模式优先使用后台默认生图模型
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled

This commit is contained in:
Your Name 2026-02-12 13:54:51 +08:00
parent 3909bae4c2
commit b34fb88c98

View File

@ -427,6 +427,17 @@ async function refineRouteWithAgent(
}
try {
const { db } = await import("@/lib/db");
const { siteSettings } = await import("@/lib/db/schema");
const [settings] = await db.select().from(siteSettings).limit(1);
const configuredDefaultModelId = settings?.canvasAutoModeDefaultModelId || null;
if (configuredDefaultModelId && baseRoute.id === configuredDefaultModelId) {
console.log(
`[Auto Agent] Keep admin default model for auto mode: ${baseRoute.displayName}`
);
return baseRoute;
}
const {
getEnabledAiModelsWithProvider,
getAgentAiModelWithProvider,